Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Win32::OLE Excel: script stops due to high excel load

by Ratazong (Monsignor)
on Jul 02, 2012 at 10:58 UTC ( [id://979413]=note: print w/replies, xml ) Need Help??


in reply to Using Win32::OLE and Excel - Tips and Tricks

Dear monks!

I think the following discovery might be useful for you:

I openend an Excel-workbook to extract some data, as instructed in the node above:

... my $Book = $Excel->Workbooks->Open($excelfile); my $Sheet = $Book->Worksheets("Sheet1"); ...
This worked with some files, but with one I repeatedly got an error-message that the operation could not be done due to some high load in Excel.

The resulting investigation showed that this special file contained very complex pivot-tables. As a result, opening it seems not to be finished when I tried to access the worksheet. Strange. Fortunately, this could be solved very easily with the following code:

... my $Book = $Excel->Workbooks->Open($excelfile); sleep(1); # give Excel time + to open the file my $Sheet = $Book->Worksheets("Sheet1"); ...

Hope this node helps you (and saves you some debugging-time) in case you encounter the same situation!

Rata

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://979413]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2025-07-08 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.