in reply to How to convert VBA macro to Windows Perl

Using Win32::OLE, you can actually run the VB macro from the opened file if you want. First specify it as a package

package MacroName;

Then you call it in the code like this:


The CPAN documentation on Win32::OLE should provide all the detail you need.

Replies are listed 'Best First'.
Re^2: How to convert VBA macro to Windows Perl
by Grygonos (Chaplain) on Jul 27, 2004 at 15:29 UTC

    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.

      I agree completely, particularly if the SOPW is using this in any kind of ongoing project.

      Running a VBA macro from the Perl code works adequately if a person is doing a quick run through some documents and data and the end goal is just to get the job done. Anything long term would be worth the extra attention and effort to convert the VBA to Perl.