Sign in to follow this  
Followers 0
redrum

Running Excel Macro w/an argument

2 posts in this topic

Hello,

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

Thanks,

Doug

Share this post


Link to post
Share on other sites



$oExcel.Run("PGProFund",$string)

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  
Followers 0