View Single Post
 
Old 04-25-2018, 02:04 AM
sg11 sg11 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Mar 2018
Posts: 5
sg11 is on a distinguished road
Default Calling a macro from a template using OnAction

I have created a template called "Sandra Macros.dotm"
I have created a custom menu to call a procedure in this template

Set myCmdBarCtl = myCommandBar.Controls.Add(msoControlButton)
with myCmdBarCtl
.BeginGroup = True
.OnAction = "=SaveAllImages()"
End with

I attach the template to the current document

If I move the procedure SaveAllImages() to Normal.dotm the button works. If not I receive an error " The macro cannot be found or has been disabled because of macro security setting" - The macro security is low ... it works when in Normal.dotm.
How should I indicate to "OnAction" to search in the template? tried adding the template name .. did not work
Reply With Quote