Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: How to operate on multiple Excel worksheets with variable array

by davies (Parson)
on Aug 09, 2016 at 12:12 UTC ( #1169397=note: print w/replies, xml ) Need Help??


in reply to Re: How to operate on multiple Excel worksheets with variable array
in thread How to operate on multiple Excel worksheets with variable array

"Additionally if you are multitasking and accidentally click on the Excel application window while the Win32::OLE is reading it you can cause other unintended consequences." True, but the OP code included $excel->{Visible} = 0;, which obviates this danger.

Regards,

John Davies

  • Comment on Re^2: How to operate on multiple Excel worksheets with variable array
  • Download Code

Replies are listed 'Best First'.
Re^3: How to operate on multiple Excel worksheets with variable array
by jandrew (Chaplain) on Aug 09, 2016 at 12:34 UTC

    It's been awhile since I went down this road but doesn't is still show up in the task bar? Sure it's more than one key stroke or if you are an 'alt-tab focus' person then that, but my recollection (and personal frustrating experience) is that the application is still running in a keystroke/mouse accessible way to the user. For any long running parsing your risk of clicking on Excel goes up especially if you use Excel for other purposes.

    This wasn't really part of my initial answer but the other risk of using Win32::OLE is that you have available both read and write capabilities for the file. In general this won't be a problem but you risk the case where you overwrite data before you have read it.

      "It's been awhile since I went down this road but doesn't is still show up in the task bar?": not in any Excel / OS combination I've used. The only way to see it is in the task manager, and then I've always had to look in processes rather than applications.

      "the other risk of using Win32::OLE is that you have available both read and write capabilities for the file": if you are creating a file that you want to be read only, you can set the OS option accordingly at creation time & Excel will respect it. That applies even if you create the file using Excel.

      I'm not trying to suggest that there aren't advantages to doing it your way in some - perhaps many - situations. But when I hack Excel, I'm usually doing something fairly technical that the WriteExcel module & its cousins can't do. So I'm always using Win32::OLE anyway (unless I'm writing directly in VBA) & therefore I'm more familiar with avoiding its dangers than with using other modules.

      Regards,

      John Davies

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2018-10-21 10:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (119 votes). Check out past polls.

    Notices?