Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default File,Save run a macro

I have a macro running when a user clicks the File Save menu option. This is
a template for many people to use. So I can't let them save the template.
However, they can do a File SaveAs to a new file. Once this is done however,
if another person brings up the template. The Macro is no longer attached to
file save. If the same user brings up the template, File Save is attached to
the macro on the previously saved file. In other words. I have a file
called Template. I have a macro run when someone does a file same. It is
called DontSave. A person does a file save as to a file called Newfile then
closes it. They then bring up the template again. If you look at the
properties for File Save, the macro it is referencing is the one in NewFile.
If a new person brings up the template, File Save is not attached to a macro
at all. Does anyone know how to make sure File Save always references the
macro on the current worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.programming
ADG ADG is offline
external usenet poster
 
Posts: 76
Default File,Save run a macro

Hi

try looking at the approach in the below link to VBA Forum

http://forums.microsoft.com/MSDN/Sho...25506&SiteID=1

This uses the Beforesave event to trap saving and give control to a user
defined macro
--
Tony Green


"officeuser1" wrote:

I have a macro running when a user clicks the File Save menu option. This is
a template for many people to use. So I can't let them save the template.
However, they can do a File SaveAs to a new file. Once this is done however,
if another person brings up the template. The Macro is no longer attached to
file save. If the same user brings up the template, File Save is attached to
the macro on the previously saved file. In other words. I have a file
called Template. I have a macro run when someone does a file same. It is
called DontSave. A person does a file save as to a file called Newfile then
closes it. They then bring up the template again. If you look at the
properties for File Save, the macro it is referencing is the one in NewFile.
If a new person brings up the template, File Save is not attached to a macro
at all. Does anyone know how to make sure File Save always references the
macro on the current worksheet?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default File,Save run a macro

Thank you. While that did not answer the question, it pointed me to a better
solution. I did not know that you could check to see if the saveAS box would
open. I used that instead. Thanks again.

"ADG" wrote:

Hi

try looking at the approach in the below link to VBA Forum

http://forums.microsoft.com/MSDN/Sho...25506&SiteID=1

This uses the Beforesave event to trap saving and give control to a user
defined macro
--
Tony Green


"officeuser1" wrote:

I have a macro running when a user clicks the File Save menu option. This is
a template for many people to use. So I can't let them save the template.
However, they can do a File SaveAs to a new file. Once this is done however,
if another person brings up the template. The Macro is no longer attached to
file save. If the same user brings up the template, File Save is attached to
the macro on the previously saved file. In other words. I have a file
called Template. I have a macro run when someone does a file same. It is
called DontSave. A person does a file save as to a file called Newfile then
closes it. They then bring up the template again. If you look at the
properties for File Save, the macro it is referencing is the one in NewFile.
If a new person brings up the template, File Save is not attached to a macro
at all. Does anyone know how to make sure File Save always references the
macro on the current worksheet?

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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Macro to save Excel file with date and time in the file name? sonic_d_hog Excel Programming 2 January 5th 06 05:57 PM
Macro Save File (Unique file name) SJC Excel Worksheet Functions 5 October 27th 05 10:09 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 10:39 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"