And on the 8th day.... Win32::OLE was created and it was good. This module implements OLE objects in perl, so you can do any VBA-capable (and VBA-incapable) action using that module. Read up on it, and use super search to find some good Win32::OLE examples.
Hope this spurs some discovery,
| [reply] |
Using Win32::OLE, you can actually run the VB macro from the opened file if you want. First specify it as a packagepackage MacroName; Then you call it in the code like this: $YourWin32Object->Run("MacroName"); The CPAN documentation on Win32::OLE should provide all the detail you need. | [reply] [d/l] [select] |
That is very true but I would advise against it. It forces you into supporting multiple platforms. If you do everything in Perl through Win32::OLE, then your developers must know Perl and the OLE package, however if you divide your development into Perl and VBA, you put extra stress on your development by requiring knowledge of both.
That being said, I know that you're using the same objects, but the programming is done diferently, (and more robustly IHMO) in Perl. I know it sounds like a zealot's way, but I say keep it all in Perl. The manipulation you can perform on your data that you are interacting with is much more robust in Perl than in VBA.
| [reply] |
| [reply] |
I wrote a script about 2 years ago that I called VBA 2 Perl. I haven't looked at the code in about 2 years but it should get you pointed in the right direction. | [reply] |