ray306 Posted January 13, 2007 Share Posted January 13, 2007 I can call and execute regular macros inExcel from autoIt. I have that needs to be passed a parameter and it would appear that my syntax is not correct. Code Follows: Func runMacros() ;Runs the Macros in the Excel Workbook With $ExcelWorkbook .Application.Run ("StartUp") .Application.Run ("TrainerYear") .Application.Run ("FilterToCrit "&$rowPg2 ) EndWith EndFunc The first two macros run just fine. I'm trying to pass the parameter on the third and it continues to fail. Any Ideas? Thanks Ray Link to comment Share on other sites More sharing options...
Locodarwin Posted January 13, 2007 Share Posted January 13, 2007 I can call and execute regular macros inExcel from autoIt. I have that needs to be passed a parameter and it would appear that my syntax is not correct. Code Follows:Func runMacros() ;Runs the Macros in the Excel Workbook With $ExcelWorkbook .Application.Run ("StartUp") .Application.Run ("TrainerYear") .Application.Run ("FilterToCrit "&$rowPg2 ) EndWithEndFunc The first two macros run just fine. I'm trying to pass the parameter on the third and it continues to fail.Any Ideas?ThanksRayTry this:.Application.Run ("FilterToCrit ", $rowPg2)You can include up to something like 20 parameters thus:.Application.Run("Macro", $param1, $param2, $param3, ...)-S (Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent] Link to comment Share on other sites More sharing options...
ray306 Posted January 14, 2007 Author Share Posted January 14, 2007 Try this:.Application.Run ("FilterToCrit ", $rowPg2)You can include up to something like 20 parameters thus:.Application.Run("Macro", $param1, $param2, $param3, ...)-SThanks LocodarwinYour suggestion did the trick. I thought I had already tried that syntax but I guess not.Thanks AgainRay 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