Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^6: Perl r/w Excel with OLE

by Sinistral (Prior)
on Jul 02, 2012 at 15:57 UTC ( #979458=note: print w/replies, xml ) Need Help??

in reply to Re^5: Perl r/w Excel with OLE
in thread Perl r/w Excel with OLE

No, you misunderstood my point. I didn't mean "use macros that are invoked by Perl using Win32::OLE". I meant "Use the macro recorder and VBA instead of using Perl". VBA and the macro recorder (which ultimately is a shiny wrapper on the underlying VBA) are the tools explicitly designed by Microsoft for automating Excel. It's just that with the power of Perl, you can do many other things that are difficult or impossible when using VBA.

After Davies explained, I now see how reusing a single instance of Excel could lead to data loss. Perhaps the authors of Win32::OLE should be contacted so that the module examples have caveats about what it really means for the system when you reuse a running Excel instance.

Replies are listed 'Best First'.
Re^7: Perl r/w Excel with OLE
by dasgar (Curate) on Jul 03, 2012 at 03:00 UTC

    Hmmm....ok. Perhaps I misunderstood you when you said:

    If I were to do simple macro type automation, then I'd record it within Excel or use the existing VBA and save myself the pain of OLE.

    That sounded like you plan to use macros for your "automation". Whether you are manually opening Excel and running the macros or using Perl to call the macros, I personally believe that the issues that I pointed out are still relevant.

    Also, by using VBA instead of Perl does not mean you escape from OLE. Any VBA code (external to Excel or inside Excel as macros) that does any Excel automation will be using OLE. The Win32::OLE module lets you access the OLE API from Perl. In other words, if you're automating Excel with VBA, macros, or Perl, you're going to use OLE in some way as far as I know.

    If I'm still misunderstanding your point, my apologies.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://979458]
[hippo]: Make it an option?
[Corion]: hippo: Yes, but I'm not sure that it's even worth the effort of implementing it at all...
[Corion]: You'll only ever need that option if you have a long-running query whose results are not cached by your DB already, and in those cases I presume that the programmer will want to maintain the temporary tables themselves - I wouldn't know when to drop ...
[Corion]: ... the temporary tables, and also don't have a good idea on how to create unique table names for them
[hippo]: OIC. In that case leave it out but invite feature requests and see if any of the users suggest it. :-)
[Corion]: Talking about this makes me realize that it's likely only a half useful idea. But it still would be convenient to have as an option...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-02-23 15:34 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (347 votes). Check out past polls.