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

D

Darin Duphorn

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

Neither worked.

Thanks
 
G

Greg Halsey

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

Darin Duphorn

Greg said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top