I'm searching for a way to call a VBA macro from another document.When I'm running e.g.: Application.GMSManager.RunMacro "GlobalMacros", "Test.ZMenExec", pIdthis works, but If I replace 'GlobalMacros' with the name of my module, it does not work anymore
Maybe you didn't wont to say what you did...
'GlobalMaros' is not a module, of course and that 'my module' where it is located? In a GMS file or in a document module?
Most likely I do not (yet) understand the macro management at Corel, I'm working mainly with Office tools, in that world macros and command bars are handled quite different.Since the GMS is the only thing I saw until now where I can take a macro from to give a menu bar an action I want to use those macros to start a subroutine within one of my documents.So my menu bar shall contain 3 or 4 buttons, when clicking one of it a macro under GMS shall check, which document is open and then start a macro inside the document. Means: Depending on the open document(s) a click on the same menu button will cause a different action.This simply shall help me to develop my tools with having the possibility to start one macro in test also from the Corel environment and not only from the VBA-Editor.
Do you work in what version of Corel?
2017
I'm afraid you cannot...
I know only two methods of calling a procedure but both of them from another GMS, not document module...
GMSManager.Projects("GlobalMacros").Macros("Teste.testMsgBox").Run GMSManager.RunMacro "GlobalMacros", "Teste.testMsgbox"
Procedures from document modules cannot be called using those ways...