Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-25-2018, 02:04 AM
sg11 sg11 is offline Calling a macro from a template using OnAction Windows 7 64bit Calling a macro from a template using OnAction Office 2010 64bit
Novice
Calling a macro from a template using OnAction
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a macro from a template using OnAction Macro added to Ribbon in template does not appear after attaching template rocky2 Word VBA 1 04-04-2016 12:00 AM
#REF Error when calling VBA Function RodneyJ Excel Programming 1 01-21-2016 12:42 PM
Calling a macro from a template using OnAction Calling a macro in powerpoint from command line SeattleITguy PowerPoint 4 11-26-2014 01:41 AM
Calling a macro from a template using OnAction .OnAction only works in document with the code donbexcel Word VBA 1 11-02-2011 05:25 AM
Re-Calling Sent Email freschij Outlook 1 12-06-2010 09:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft