Author: Mike Shkolnik
Open the password-protected xls-file and save without password
Answer:
Today I want to show how you may load some xls-file that is password-protected, and
how to save xls into another file but without protection.
1 var2 xls, xlw: Variant;
3 begin4 {load MS Excel}5 xls := CreateOLEObject('Excel.Application');
6 7 {open your xls-file}8 xlw := xls.WorkBooks.Open(FileName := 'd:\book1.xls', Password := 'qq',
9 ReadOnly := True);
10 {save with other file name}11 xlw.SaveAs(FileName := 'd:\book2.xls', Password := '');
12 13 {unload MS Excel}14 xlw := UnAssigned;
15 xls := UnAssigned;
16 end;
Just replace there file names and password