Jump to content

Run excel macro within autoit


 Share

Recommended Posts

Hey all, is there an way to call an excel macro by name within autoit? i'm currently just sending my hot key after opening the sheet with macro stored in it. Thanks.

Look at the _Excel* functions of the Excel.au3 UDF. Once you open the workbook, you should be able to do $oExcel.Run("Macro_Name").

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • 4 weeks later...

I'm not finding that function in Excel.au3

The use of the object method $oExcel.Run("Macro_Name") is not in the UDF. The .Run method is part of the Excel workbook object.

I meant use the function _ExcelBookAttach(), _ExcelBookNew(), or _ExcelBookOpen() to get the object reference in $oExcel. Then, you can run a macro by doing $oExcel.Run("Macro_Name").

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

The use of the object method $oExcel.Run("Macro_Name") is not in the UDF. The .Run method is part of the Excel workbook object.

I meant use the function _ExcelBookAttach(), _ExcelBookNew(), or _ExcelBookOpen() to get the object reference in $oExcel. Then, you can run a macro by doing $oExcel.Run("Macro_Name").

:P

I have tried the $oExcel.Run("Move")

Move being my macro name and it gives me an error: Expected a "a" in assignment statement.... What is wrong

Do I need more than one line of code to run this macro?

Link to comment
Share on other sites

I have tried the $oExcel.Run("Move")

Move being my macro name and it gives me an error: Expected a "a" in assignment statement.... What is wrong

Do I need more than one line of code to run this macro?

Don't double post. Answered in your own topic.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...