thmsdrew has asked for the wisdom of the Perl Monks concerning the following question:
I've been using Win32::OLE to clean up some data in a spreadsheet. Usually involves a loop that iterates over every row, modifying certain rows in certain ways.
At one point I ran into a situation where, on one of the iterations of my loop, my code erred, and my script stopped without getting to the $book->Close; $excel->Quit; part at the end.
Is there a way that I can always Close and Quit no matter what? I could put an or die after each bit of code that might fail, but that seems kind of inelegant.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE Excel: Close and Quit no matter what happens
by Corion (Patriarch) on Aug 06, 2014 at 15:09 UTC | |
by thmsdrew (Scribe) on Aug 06, 2014 at 15:12 UTC |