Solved: Calling macro in another project
Hi,
I'd like to call a macro from a different project so that I can reuse code. Both macros are in different TemplateProjects in Word's startup folder. The example I see in VB Help uses square brackets and a project file :
[Project X.vba][ModuleName]MacroName()
Since I want to call one subroutine from a macro in another module, I tried the following :
Call [GeneralOptions.dot][AutoExec]AddShortcut(x, y, z)
where x,y,z are the arguments passed to the function AddShortcut in the macro AutoExec in my TemplateProject GeneralOptions.dot in the startup folder.
The above syntax doesn't work on OSX 10.2.8 and Office/Word 10.1.6. I get Sub/Function not found.
How do I call a macro in one TemplateProject from another Template Project in OSX ? Am I missing the path to the Template Project ?
Any ideas would be greatly appreciated!
Ed
Run method and Reference Object Library
Hi Ken,
The Run method on the Mac is also limited to subroutines/functions w/o arguments as stated in the VBA Help manual:
"Note Only public Sub procedures that take no arguments, which includes all procedures generated by the macro recorder and all procedures you can run from the Macros dialog box, can be run by using the Run method."
I've tried specifying the project by name with and without a postfix, but no go. I couldn't get any of them to work.
I know that the VBA 10.1.6 (Office X.1.6) is missing the split and join functions for example. Is it possible that VBA on the Mac is missing the "Reference Object Library" needed to get VBA to do the linkage at runtime to external symbols in other projects?
Ed