gkeppler Posted February 2, 2009 Share Posted February 2, 2009 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. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 2, 2009 Share Posted February 2, 2009 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 More sharing options...
gkeppler Posted February 3, 2009 Author Share Posted February 3, 2009 Thanks. you guys are quick.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"). Link to comment Share on other sites More sharing options...
mpcluever Posted February 28, 2009 Share Posted February 28, 2009 I'm not finding that function in Excel.au3 Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 28, 2009 Share Posted February 28, 2009 I'm not finding that function in Excel.au3The 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"). 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 More sharing options...
mpcluever Posted February 28, 2009 Share Posted February 28, 2009 Excellent. Works perfect. Thanks!! Link to comment Share on other sites More sharing options...
martmeister Posted March 5, 2009 Share Posted March 5, 2009 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"). 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 wrongDo I need more than one line of code to run this macro? Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 5, 2009 Share Posted March 5, 2009 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 wrongDo I need more than one line of code to run this macro?Don't double post. Answered in your own topic. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now