Hello. I am coding for my work, using Reflection Desktop 16 and MS Excel v15. I am trying to invoke a macro on Reflection from Excel. When I use the RunMacro method, I get the 'Expected Function or Variable' compile error.
The function called returns a user-defined class and when I run it from Reflection VBA it returns the class nicely, so that isn't the problem. It is a possibility that I don't have the class set up correctly yet on Excel but I am feeling that I'm not coding the arguments correctly to call the function. I am using Early Binding and Intellisense is giving me the macro parameters so it is seeing the terminal object at least. I tried coding this off the example from 'Running Reflection Macros from Excel or Another Application' in your Key Concepts, but that is using RunMacro2 and calling a subroutine and I need to pass a paramter (paramarrays make me want to jump out of a window so I'm desperately hoping to avoid RunMacro3.)
I could use a little guidance, please.
Command line (I have tried both of these with the same result):
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, "ThisIbmTerminal.HelpExcel", "(input string)")
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, strMac, strInput) (wrapped the strings)
Macro in Reflection --> Public Function HelpExcel(strA As String) As MyObject
(This procedure actually calls another Reflection function because it has to do a little manipulation to that string first, because paramarrays. I think the second function would throw the error in Reflection, not Excel, though.)
My project in the Project Window Looks like this:
MacroContainer (MacroScreen)
|
-> Modules
|
->ExcelSupportMacros
I have tried qualifying the MacroName in the following manners:
ThisIbmTerminal.HelpExcel
ThisIbmTerminal.MacroContainer.Modules.ExcelSupportMacros.HelpExcel
MacroContainer.Modules.ExcelSupportMacros.HelpExcel
Modules.ExcelSupportMacros.HelpExcel
MacroContainer.ExcelSupportMacros.HelpExcel
ExcelSupportMacros.HelpExcel
MacroContainer.HelpExcel
(Edit: the space in Document is being added by this form, it is spelled correctly in my code.)
#Reflection
Page 1 / 1
Hello. I am coding for my work, using Reflection Desktop 16 and MS Excel v15. I am trying to invoke a macro on Reflection from Excel. When I use the RunMacro method, I get the 'Expected Function or Variable' compile error.
The function called returns a user-defined class and when I run it from Reflection VBA it returns the class nicely, so that isn't the problem. It is a possibility that I don't have the class set up correctly yet on Excel but I am feeling that I'm not coding the arguments correctly to call the function. I am using Early Binding and Intellisense is giving me the macro parameters so it is seeing the terminal object at least. I tried coding this off the example from 'Running Reflection Macros from Excel or Another Application' in your Key Concepts, but that is using RunMacro2 and calling a subroutine and I need to pass a paramter (paramarrays make me want to jump out of a window so I'm desperately hoping to avoid RunMacro3.)
I could use a little guidance, please.
Command line (I have tried both of these with the same result):
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, "ThisIbmTerminal.HelpExcel", "(input string)")
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, strMac, strInput) (wrapped the strings)
Macro in Reflection --> Public Function HelpExcel(strA As String) As MyObject
(This procedure actually calls another Reflection function because it has to do a little manipulation to that string first, because paramarrays. I think the second function would throw the error in Reflection, not Excel, though.)
My project in the Project Window Looks like this:
MacroContainer (MacroScreen)
|
-> Modules
|
->ExcelSupportMacros
I have tried qualifying the MacroName in the following manners:
ThisIbmTerminal.HelpExcel
ThisIbmTerminal.MacroContainer.Modules.ExcelSupportMacros.HelpExcel
MacroContainer.Modules.ExcelSupportMacros.HelpExcel
Modules.ExcelSupportMacros.HelpExcel
MacroContainer.ExcelSupportMacros.HelpExcel
ExcelSupportMacros.HelpExcel
MacroContainer.HelpExcel
(Edit: the space in Document is being added by this form, it is spelled correctly in my code.)
#Reflection
The function called returns a user-defined class and when I run it from Reflection VBA it returns the class nicely, so that isn't the problem. It is a possibility that I don't have the class set up correctly yet on Excel but I am feeling that I'm not coding the arguments correctly to call the function. I am using Early Binding and Intellisense is giving me the macro parameters so it is seeing the terminal object at least. I tried coding this off the example from 'Running Reflection Macros from Excel or Another Application' in your Key Concepts, but that is using RunMacro2 and calling a subroutine and I need to pass a paramter (paramarrays make me want to jump out of a window so I'm desperately hoping to avoid RunMacro3.)
I could use a little guidance, please.
Command line (I have tried both of these with the same result):
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, "ThisIbmTerminal.HelpExcel", "(input string)")
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, strMac, strInput) (wrapped the strings)
Macro in Reflection --> Public Function HelpExcel(strA As String) As MyObject
(This procedure actually calls another Reflection function because it has to do a little manipulation to that string first, because paramarrays. I think the second function would throw the error in Reflection, not Excel, though.)
My project in the Project Window Looks like this:
MacroContainer (MacroScreen)
|
-> Modules
|
->ExcelSupportMacros
I have tried qualifying the MacroName in the following manners:
ThisIbmTerminal.HelpExcel
ThisIbmTerminal.MacroContainer.Modules.ExcelSupportMacros.HelpExcel
MacroContainer.Modules.ExcelSupportMacros.HelpExcel
Modules.ExcelSupportMacros.HelpExcel
MacroContainer.ExcelSupportMacros.HelpExcel
ExcelSupportMacros.HelpExcel
MacroContainer.HelpExcel
(Edit: the space in Document is being added by this form, it is spelled correctly in my code.)
#Reflection
It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.
These forums are peer-to-peer, best effort, volunteer run and that if your issue
is urgent or not getting a response, you might try one of the following options:
- Visit https://www.microfocus.com/support-and-services and search the knowledgebase and/or check
all the other self support options and support programs available.
- Open a service request: https://www.microfocus.com/support
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.microfocus.com)
- You might consider hiring a local partner to assist you.
https://www.partnernetprogram.com/partnerfinder/find.html
Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.microfocus.com/faq.php
Sometimes this automatic posting will alert someone that can respond.
If this is a reply to a duplicate posting or otherwise posted in error, please
ignore and accept our apologies and rest assured we will issue a stern reprimand
to our posting bot.
Good luck!
Your Micro Focus Forums Team
http://forums.microfocus.com
Hello. I am coding for my work, using Reflection Desktop 16 and MS Excel v15. I am trying to invoke a macro on Reflection from Excel. When I use the RunMacro method, I get the 'Expected Function or Variable' compile error.
The function called returns a user-defined class and when I run it from Reflection VBA it returns the class nicely, so that isn't the problem. It is a possibility that I don't have the class set up correctly yet on Excel but I am feeling that I'm not coding the arguments correctly to call the function. I am using Early Binding and Intellisense is giving me the macro parameters so it is seeing the terminal object at least. I tried coding this off the example from 'Running Reflection Macros from Excel or Another Application' in your Key Concepts, but that is using RunMacro2 and calling a subroutine and I need to pass a paramter (paramarrays make me want to jump out of a window so I'm desperately hoping to avoid RunMacro3.)
I could use a little guidance, please.
Command line (I have tried both of these with the same result):
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, "ThisIbmTerminal.HelpExcel", "(input string)")
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, strMac, strInput) (wrapped the strings)
Macro in Reflection --> Public Function HelpExcel(strA As String) As MyObject
(This procedure actually calls another Reflection function because it has to do a little manipulation to that string first, because paramarrays. I think the second function would throw the error in Reflection, not Excel, though.)
My project in the Project Window Looks like this:
MacroContainer (MacroScreen)
|
-> Modules
|
->ExcelSupportMacros
I have tried qualifying the MacroName in the following manners:
ThisIbmTerminal.HelpExcel
ThisIbmTerminal.MacroContainer.Modules.ExcelSupportMacros.HelpExcel
MacroContainer.Modules.ExcelSupportMacros.HelpExcel
Modules.ExcelSupportMacros.HelpExcel
MacroContainer.ExcelSupportMacros.HelpExcel
ExcelSupportMacros.HelpExcel
MacroContainer.HelpExcel
(Edit: the space in Document is being added by this form, it is spelled correctly in my code.)
#Reflection
The function called returns a user-defined class and when I run it from Reflection VBA it returns the class nicely, so that isn't the problem. It is a possibility that I don't have the class set up correctly yet on Excel but I am feeling that I'm not coding the arguments correctly to call the function. I am using Early Binding and Intellisense is giving me the macro parameters so it is seeing the terminal object at least. I tried coding this off the example from 'Running Reflection Macros from Excel or Another Application' in your Key Concepts, but that is using RunMacro2 and calling a subroutine and I need to pass a paramter (paramarrays make me want to jump out of a window so I'm desperately hoping to avoid RunMacro3.)
I could use a little guidance, please.
Command line (I have tried both of these with the same result):
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, "ThisIbmTerminal.HelpExcel", "(input string)")
Set objMyObject = termRefl.Macro.RunMacro(MacroEnumerationOption_Document, strMac, strInput) (wrapped the strings)
Macro in Reflection --> Public Function HelpExcel(strA As String) As MyObject
(This procedure actually calls another Reflection function because it has to do a little manipulation to that string first, because paramarrays. I think the second function would throw the error in Reflection, not Excel, though.)
My project in the Project Window Looks like this:
MacroContainer (MacroScreen)
|
-> Modules
|
->ExcelSupportMacros
I have tried qualifying the MacroName in the following manners:
ThisIbmTerminal.HelpExcel
ThisIbmTerminal.MacroContainer.Modules.ExcelSupportMacros.HelpExcel
MacroContainer.Modules.ExcelSupportMacros.HelpExcel
Modules.ExcelSupportMacros.HelpExcel
MacroContainer.ExcelSupportMacros.HelpExcel
ExcelSupportMacros.HelpExcel
MacroContainer.HelpExcel
(Edit: the space in Document is being added by this form, it is spelled correctly in my code.)
#Reflection
ThisIbmTerminal.Macro.RunMacro MacroEnumerationOption_Document, "Module1.HelpExcel", ""
I might not be understanding the question though. Does that help?
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.