Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > win32ole encript document excel

Reply
Thread Tools

win32ole encript document excel

 
 
Foreero Ivan
Guest
Posts: n/a
 
      09-12-2008
does anybody how to protect a excel document made with ruby and then put
a password /??
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
David Mullet
Guest
Posts: n/a
 
      09-13-2008
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.blogspot.com/
http://rubyonwindows.blogspot.com/search/label/excel
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Foreero Ivan
Guest
Posts: n/a
 
      09-13-2008

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WIN32OLE, IE, open an html document.. Aldric Giacomoni Ruby 1 01-23-2009 09:42 PM
WIN32OLE - failed to create WIN32OLE zxem Ruby 1 12-19-2007 07:01 PM
WIN32OLE#[] and WIN32OLE#[]= method in Ruby 1.9 (or later) Masaki Suketa Ruby 4 03-27-2006 11:17 AM
How to encript data without iv via 3DES? wolf ASP .Net 0 04-07-2005 07:44 AM
How to encript header files. Haro Panosyan C++ 11 03-30-2005 02:14 PM



Advertisments