Application := OLE2.create_obj('Excel.Application');
Workbooks := OLE2.get_obj_property(Application,'Workbooks');
Workbook := OLE2.invoke_obj(Workbooks,'Add' ); OLE2.SET_PROPERTY(workbook,'Password', '12345');
ole2.invoke (workbooks, 'Save' ,Arglist );
12345 is your password to that excel sheet...
Edited by: Dora on Dec 23, 2009 9:24 AM
Magically I fixed this problem using:
Worksheets := OLE2.get_obj_property(Workbook, 'Worksheets');
Worksheet := OLE2.get_obj_property(Application, 'ActiveSheet');
Where 1234 is the password.
I said magically because I can't finded a solution on internet, so I tried with the word PROTECT... and that was the solution!!!
If somebody know where find detail help about how to use ole with excel, please let us know too... Thanks...