How do I save excel file with password for read only access ?
Hi
I am trying to save an excel file with a password to make it read only when opened
using OLE2 . I am having a problem with the parameter list. This is my code that does
work.
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'C:\Reports\Excel\File.xls');
ole2.add_arg(args, 0);
ole2.add_arg(args, 0);
ole2.add_arg(args, 'TEST');
ole2.add_arg(args, 0);
ole2.add_arg(args, 0);
ole2.add_arg(args, 1);
I also have the following code at the beginning of the program to suppress dialogs.
OLE2.SET_PROPERTY(application,'DisplayAlerts', 'FALSE');
ole2.set_property(application,'Visible', 'false');