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

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

Neither worked.

Thanks

well, these links may help.

http://www.weheartcode.com/2007/10/05/reading-an-excel-file-with-ruby

On Feb 4, 2008 10:41 AM, Darin D. [email protected]
wrote:

Posted via http://www.ruby-forum.com/.
Have a look at the parseexcel gem
http://raa.ruby-lang.org/project/parseexcel/

Darin D. 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})

Greg H. wrote:

Darin D. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs