pankaj_it09 has asked for the wisdom of the Perl Monks concerning the following question:
package ExcelFileIsProtected; sub ExcelFileIsProtected { my ($path_to_file) = @_; # One argument wait use Win32::OLE; my $xlApp = Win32::OLE->new('Excel.Application'); $xlApp->{DisplayAlerts} = 0; # Open excel file. my $xlBook = $xlApp->Workbooks->Open($path_to_file); my $Sheet1 = $xlBook->Worksheets(1); my $row = 1; my $col = 1; $Sheet1->Cells($row,$col)->{'Value'} = 5; if (Win32::OLE->LastError) { return true; } else { return false; } $xlBook ->Close(); undef $xlBook; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Detecting Protected Excel Files where only the sheets are protected.
by Corion (Patriarch) on Feb 19, 2009 at 14:06 UTC | |
| |
|