[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

win32ole encript document excel

Foreero Ivan

9/12/2008 11:49:00 PM

does anybody how to protect a excel document made with ruby and then put
a password /??
--
Posted via http://www.ruby-....

2 Answers

David Mullet

9/13/2008 2:15:00 PM

0

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

http://rubyonwindows.blo...
http://rubyonwindows.blo...search/label/excel
--
Posted via http://www.ruby-....

Foreero Ivan

9/13/2008 3:20:00 PM

0


Thanks !!!!
--
Posted via http://www.ruby-....