sylayo Absent Member.
Absent Member.
141 views

How to call a sub using a variable

Hi,

I'm trying to create a kind of menu, listing all the available macros we have, so my users can pick the one they want to execute.

I've put all the macros name with the sub to call in a picklist. when the user select a macro, I'm trying to call the associated function but a "Call myFileName" does not work.

I've seen some notes in various web side suggesting to use "Application.run" but I receive a "Run-time error '438' - Object doesn't support this property or method). I think this will only work for Excel, Word and Access...

I'm running out of idea now so any trick would be appreciated?
0 Likes
1 Reply
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: How to call a sub using a variable

Sylayo,

I am not sure what version or edition of Reflection you are referring to here nor what type of Macro. If you are referring to VBA Macros, have a look at the VBA Programming Guide. If you need help with troubleshooting, it is better for you to contact our support team via email.

Thanks,
Jeff
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.