newcoder1010 Posted August 17, 2017 Share Posted August 17, 2017 (edited) Hello, I have this function to launch the application: Public Function OpenApplication(exePath) SystemUtil.Run exePath OpenApplication = 1 End Function 'Calling the function works. url = "examplesite.com" aa = OpenApplication(url) 'Instead of calling from the script, I would like to move the function and parameter in excel. So, in excel, I have two columns: method and parameter My script goes to excel, read the method and parameter then make the call. I get type mismatch error at the last line myMethod(myParam). myMethod = SheetOne.Cells(2, 3) myParam = SheetOne.Cells(2, 4) myMethod(myParam) Please advise. Edited August 17, 2017 by newcoder1010 Link to comment Share on other sites More sharing options...
justsomeguy Posted August 17, 2017 Share Posted August 17, 2017 myMethod just contains a string, it's not a function. It looks like you can use GetRef to get the function by name. e.g.: f = "OpenApplication" func = GetRef(f) func(url) 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