Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Do not save macro with workbook

I have a template with a startup macro in it and I would like to not save the
macro when they save the workbook. There are other macros in there that I
would like to save with the file. Any good ideas? Thanks! Jeff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Do not save macro with workbook

You could remove the macro, but that would depend on what the user's security
settings are.

Since you're keeping other macros, why not just make it so that it doesn't run?

Sub Workbook_Open()
if me.path < "" then
exit sub
end if

'real code here
End sub

Or

Sub Auto_Open()
if thisworkbook.path < "" then
exit sub
end if

'real code here
End sub


Jeff wrote:

I have a template with a startup macro in it and I would like to not save the
macro when they save the workbook. There are other macros in there that I
would like to save with the file. Any good ideas? Thanks! Jeff


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Do not save macro with workbook

That will work. Thanks you Dave!

"Dave Peterson" wrote:

You could remove the macro, but that would depend on what the user's security
settings are.

Since you're keeping other macros, why not just make it so that it doesn't run?

Sub Workbook_Open()
if me.path < "" then
exit sub
end if

'real code here
End sub

Or

Sub Auto_Open()
if thisworkbook.path < "" then
exit sub
end if

'real code here
End sub


Jeff wrote:

I have a template with a startup macro in it and I would like to not save the
macro when they save the workbook. There are other macros in there that I
would like to save with the file. Any good ideas? Thanks! Jeff


--

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
Macro save workbook puiuluipui Excel Discussion (Misc queries) 3 November 13th 09 04:40 PM
Macro to save workbook puiuluipui Excel Discussion (Misc queries) 3 October 7th 09 09:17 PM
Save workbook not macro [email protected] Excel Programming 1 August 3rd 07 03:29 PM
possible to save macro with workbook as add-in? John Smith Excel Programming 3 November 29th 06 05:35 PM
"Save" macro problem, still prompted to save when closing workbook (?) StargateFanFromWork[_4_] Excel Programming 8 September 13th 06 04:49 PM


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

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"