How do I run macros upon opening only if it is not the template?

D

davis6206

I currently have a Private Sub that is supposed to run on Workbook_Open. It
runs macros when I open that particular workbook. However, that workbook is
a template. I don't want the macros to run when I'm opening the template. I
only want them to run if I'm creating a new workbook using that template.
How do I tell it to run the macros depending on whether I'm opening the
template or creating a new workbook using the template?
 
O

Office_Novice

Try putting the code in Workbook_New rather then _open. This should solve
your problem
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top