Win32ole encript document excel

does anybody how to protect a excel document made with ruby and then put
a password /??

···

--
Posted via http://www.ruby-forum.com/.

Foreero Ivan wrote:

does anybody how to protect a excel document made with ruby and then put
a password /??

To password-protect an Excel workbook, set the workbook object's
Password property before calling the SaveAs() method:

wb.Password = 'MyPassword'
wb.SaveAs('c:\temp\xlpsw.xls')

To open a password-protected workbook, either call the standard Open()
method...

wb = xl.Workbooks.Open('c:\temp\xlpsw.xls')

...and then you will be prompted to enter the password...

...or pass the password as an argument hash to the Open() method:

wb = xl.Workbooks.Open('c:\temp\xlpsw.xls', {'password' =>
'MyPassword'})

Hope that helps.

David

···

--
Posted via http://www.ruby-forum.com/\.

Thanks !!!!

···

--
Posted via http://www.ruby-forum.com/.