#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default AutoNew

In Word, I've built templates containing a Sub AutoNew procedure where a
userform opens only when a new document is created from them. After that,
upon reopening the document, the form no longer shows.

Does Excel have an equivalent to AutoNew? I want users (when they choose
File New to create a new spreadsheet from a template) only to see a
userform the first time they use the template, not when subsequently
reopening the spreadsheet. Thanks!

Steve C
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default AutoNew

Not really.

But you could use Auto_open() and check to see if it's a template:

Option Explicit
sub Auto_open()
if thisworkbook.path < "" then
exit sub
end if
'do the real work
end sub

Steve C wrote:

In Word, I've built templates containing a Sub AutoNew procedure where a
userform opens only when a new document is created from them. After that,
upon reopening the document, the form no longer shows.

Does Excel have an equivalent to AutoNew? I want users (when they choose
File New to create a new spreadsheet from a template) only to see a
userform the first time they use the template, not when subsequently
reopening the spreadsheet. Thanks!

Steve C


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default AutoNew

Thanks, Dave. That gives me a good work-around.

"Dave Peterson" wrote:

Not really.

But you could use Auto_open() and check to see if it's a template:

Option Explicit
sub Auto_open()
if thisworkbook.path < "" then
exit sub
end if
'do the real work
end sub

Steve C wrote:

In Word, I've built templates containing a Sub AutoNew procedure where a
userform opens only when a new document is created from them. After that,
upon reopening the document, the form no longer shows.

Does Excel have an equivalent to AutoNew? I want users (when they choose
File New to create a new spreadsheet from a template) only to see a
userform the first time they use the template, not when subsequently
reopening the spreadsheet. Thanks!

Steve C


--

Dave Peterson

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
AutoNew Kas Excel Programming 2 November 20th 03 03:41 AM


All times are GMT +1. The time now is 12:12 PM.

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

About Us

"It's about Microsoft Excel"