Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How to convert VBA macro to Windows Perl

by WhiteBird (Hermit)
on Jul 27, 2004 at 02:00 UTC ( #377634=note: print w/replies, xml ) Need Help??


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:

$YourWin32Object->Run("MacroName");

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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2022-05-17 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (68 votes). Check out past polls.

    Notices?