in reply to Re^3: RFC: Win32::OLE and Excel's RefreshAll
in thread RFC: Win32::OLE and Excel's RefreshAll

Sorry this is a little late in coming, but here's how to check the read only flag.
use strict; use warnings; use Win32::OLE; my $xlsFile = "c:\\temp\\myexcelfile.xls"; my $excel = Win32::OLE->new('Excel.Application', 'Quit'); my $book = $excel->Workbooks->Open("$xlsFile") or die; if($book->{ReadOnly}+0 > 0){#the funny +0 is an easy way to force the +scalar to be interpreted as a number warn "$xlsFile is open Read Only!"; $book->Close; $book = undef; $excel = undef; }