Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I run macros upon opening only if it is not the template?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default How do I run macros upon opening only if it is not the template?

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

"davis6206" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Template opening Galliano Excel Discussion (Misc queries) 3 April 7th 06 05:00 PM
Opening a template.xls using VBA code. a Excel Programming 1 December 19th 05 02:40 AM
Opening a template .xls with VBA code IXLINXL Excel Programming 5 December 1st 04 08:05 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
Opening Template Srinath Excel Programming 2 August 28th 03 04:05 PM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"