in reply to Re^2: Problems parsing Excel 2010 .xlsx file with Win32::OLE
in thread Problems parsing Excel 2010 .xlsx file with Win32::OLE
Win32::OLE->GetActiveObject('Excel.Application')
grabs the background Excel process you started previously, which now has all of the data. Since you're quitting anyways I would remove this (just create a new instance) and try sleep-ing for a few minutes after RefreshAll. You may need a while(1) loop that checks on the status of the data query, or set the BackgroundQuery property to 0 on every object (if that's the root problem).
Installing a signal handler to close and exit would also prevent Excel staying open in the background:
$SIG{INT} = sub { cleanup(); die "Caught interrupt"; }; ... (main code) ... cleanup(); sub cleanup { $Book->Save(); $Book->Close(); $Excel->Quit(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Problems parsing Excel 2010 .xlsx file with Win32::OLE
by mwarrior (Initiate) on Feb 22, 2012 at 21:48 UTC |