How To Point RUNADDON To The Stencil File Macro

Started by wkelly24, August 15, 2017, 09:44:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wkelly24

Looking back at this post:  http://visguy.com/vgforum/index.php?topic=6222.msg25399#msg25399

I'm trying to verify what the proper syntax is for pointing to two Macros that is contained in the ThisDocument or the Module1 portion of the stencil file with the RUNADDON function in the Action Section of Sheet Properties. When using the following, the Macro does not execute.

=RUNADDON("MacroStencils.ThisDocument.Test2")
=RUNADDON("MacroStencils.Module1.Test2")

What am I missing?

Here is the content of the ThisDocument Macro:
Sub Test1()

Debug.Print "This is Test1 from MacroStencils.ThisDocument"

End Sub

Sub Test2()

Debug.Print "This is Test2 from MacroStencils.ThisDocument"

End Sub

Code in the Module1 Object:
Sub Test1()

Debug.Print "This is Test1 from MacroStencils.Module1"

End Sub

Sub Test2()

Debug.Print "This is Test2 from MacroStencils.Module1"

End Sub


Finally, please note both of these are in the document file, and I am able to reference both macro's successfully.

Thanks for your time on this.

W<

Croc

If you can not find the cause, then you can use RUNMACRO instead. It works fine.
But RUNMACRO uses a bit different syntax. The project name is specified as a second parameter.
=RUNMACRO("ThisDocument.Test2", "MacroStencils")

wkelly24

Thank you!  ;D

That worked exactly as I need it. Thanks for helping this rookie.  :o

Best Regards!