Jump to content
Sign in to follow this  

Running Excel Macro w/an argument

Recommended Posts



I am using this statement to execute an Excel macro within an AutoIt script and it is working fine:

$oExcel.Run("PGProFund") ;run the macro

I now am adding an argument to the Excel Macro as follows:

Sub PGProFund(Name as String)


statements - -


End Sub

How can I pass this argument to the Excel macro when executing it from within AutoIt?

I have searched both help and Form and cannot seem to find this out.

I tried the following just in case it was this simple:

$oExcel.Run("PGProFund") $string ;run the macro and pass argument?

But no luck!

When I run the macro from a CMD line with the argument it works fine.

I expect this is quite simple, but cannot seem to find the answer



Share this post

Link to post
Share on other sites


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.