in reply to Re^2: Perl r/w Excel with OLE
in thread Perl r/w Excel with OLE
I'm afraid I have to disagree extremely strongly with some of the advice you've given here. Some of the issues are minor, such as always hiding the spreadsheet in production code. What if I want to present the user with the spreadsheet? Usually I hide, but it's definitely horses for courses.
More serious is taking control of an existing instance. For a one-off script, this can be a useful club to have in your bag, but I've written elsewhere (Re: Manipulating open excel sheet) about why this is a bad idea.
However, the thing that really terrifies me is that your code not only takes control of one of my instances of Excel (I frequently run several - it can be essential to do this), but then closes it. My work! Where has all my work gone? And there's not even an autosave, as those files are automatically deleted when the creating instance exits normally. Now I'll grant you that it can be useful to loop through all instances of Excel and close them if you know for sure that they are all orphans, but the thought of this getting into production code turns me cold even in this weather.