Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Does anyone know how to open a excel file in read only?

Reply
Thread Tools

Does anyone know how to open a excel file in read only?

 
 
Darin Duphorn
Guest
Posts: n/a
 
      02-04-2008

I've tried:
$Test_suite_workbook = excel.workbooks.open(FileName,ReadOnly:=True)
and
$Test_suite_workbook = excel.workbooks.openFileName),ReadOnly:=True

Neither worked.

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

 
Reply With Quote
 
 
 
 
ben baka
Guest
Posts: n/a
 
      02-04-2008
[Note: parts of this message were removed to make it a legal post.]

well, these links may help.

http://www.weheartcode.com/2007/10/0...file-with-ruby



On Feb 4, 2008 3:41 PM, Darin Duphorn <> wrote:

>
> I've tried:
> $Test_suite_workbook = excel.workbooks.open(FileName,ReadOnly:=True)
> and
> $Test_suite_workbook = excel.workbooks.openFileName),ReadOnly:=True
>
> Neither worked.
>
> Thanks
> --
> Posted via http://www.ruby-forum.com/.
>
>



--
--Ben Baka
Blog : http://benjaminbaka.wordpress.com/

 
Reply With Quote
 
 
 
 
Jayson Williams
Guest
Posts: n/a
 
      02-04-2008
On Feb 4, 2008 10:41 AM, Darin Duphorn <> wrote:
>
> I've tried:
> $Test_suite_workbook = excel.workbooks.open(FileName,ReadOnly:=True)
> and
> $Test_suite_workbook = excel.workbooks.openFileName),ReadOnly:=True
>
> Neither worked.
>
> Thanks
> --
> Posted via http://www.ruby-forum.com/.


Have a look at the parseexcel gem
http://raa.ruby-lang.org/project/parseexcel/

 
Reply With Quote
 
Greg Halsey
Guest
Posts: n/a
 
      02-04-2008
Darin Duphorn wrote:
>
> I've tried:
> $Test_suite_workbook = excel.workbooks.open(FileName,ReadOnly:=True)
> and
> $Test_suite_workbook = excel.workbooks.openFileName),ReadOnly:=True
>
> Neither worked.
>
> Thanks


try giving open() parameters as block...

xlApp=WIN32OLE::new('Excel.Application')
xlApp.Visible=1
xl_file = ('c:\\file.xls')
xlApp.Workbooks.Open({'filename'=> xl_file, 'readOnly' => true})
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Darin Duphorn
Guest
Posts: n/a
 
      02-04-2008
Greg Halsey wrote:
> Darin Duphorn wrote:
>>
>> I've tried:
>> $Test_suite_workbook = excel.workbooks.open(FileName,ReadOnly:=True)
>> and
>> $Test_suite_workbook = excel.workbooks.openFileName),ReadOnly:=True
>>
>> Neither worked.
>>
>> Thanks

>
> try giving open() parameters as block...
>
> xlApp=WIN32OLE::new('Excel.Application')
> xlApp.Visible=1
> xl_file = ('c:\\file.xls')
> xlApp.Workbooks.Open({'filename'=> xl_file, 'readOnly' => true})


Thanks Greg that worked.

DD
--
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: how to open a file in some application using Tkinter i am usingTKINTER to create GUI application i want to know how to open a worddocument in open office or any other applicatio Fredrik Lundh Python 1 01-09-2008 10:40 AM
Does anyone know? Please Read [Third Attempt] DaBrain ASP .Net 1 11-29-2006 01:29 PM
Does anyone Know Anyone at Maas Rowe I can talk to channing28270@gmail.com Computer Support 3 07-05-2006 08:27 AM
LOOK! i just want to know does anyone know... Simon Egginton Javascript 3 07-26-2004 08:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57