Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
heski
 
Posts: n/a
Default Running a macro "On Save"


Hi,

Can anyone tell me how I can get a file to run a macro each time the
file is saved. I know this is achievable but can't find how to do it.

Thanks in advance for any assistance.


--
heski
------------------------------------------------------------------------
heski's Profile: http://www.excelforum.com/member.php...o&userid=30581
View this thread: http://www.excelforum.com/showthread...hreadid=543201

  #2   Report Post  
Posted to microsoft.public.excel.misc
papou
 
Posts: n/a
Default Running a macro "On Save"

Hello
Use this workbook event which fires before saving workbook :
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not Cancel Then
'do your stuff here
End If
End Sub

To acces this event either right-click on the Excel icon immediately
situated left to th File Menu in Excel
or open VB Editor and double-click on Thisworkbook

HTH
Cordially
Pascal

"heski" a écrit dans le
message de news: ...

Hi,

Can anyone tell me how I can get a file to run a macro each time the
file is saved. I know this is achievable but can't find how to do it.

Thanks in advance for any assistance.


--
heski
------------------------------------------------------------------------
heski's Profile:
http://www.excelforum.com/member.php...o&userid=30581
View this thread: http://www.excelforum.com/showthread...hreadid=543201



  #3   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Running a macro "On Save"


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.Run "PutYourMacroNameHere"
End Sub

Vaya con Dios,
Chuck, CABGx3


"heski" wrote:


Hi,

Can anyone tell me how I can get a file to run a macro each time the
file is saved. I know this is achievable but can't find how to do it.

Thanks in advance for any assistance.


--
heski
------------------------------------------------------------------------
heski's Profile: http://www.excelforum.com/member.php...o&userid=30581
View this thread: http://www.excelforum.com/showthread...hreadid=543201


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
Running Macro minimises window PaulW Excel Discussion (Misc queries) 1 April 19th 06 04:49 PM
Macro Help In Excel welshlad Excel Discussion (Misc queries) 14 October 26th 05 02:34 PM
Macro running when a cell is exited Daniel Lees Excel Discussion (Misc queries) 1 July 20th 05 02:45 PM
Macro running problem Pat Excel Discussion (Misc queries) 2 May 20th 05 10:45 PM
Running VBA Macro Jeff Excel Discussion (Misc queries) 1 February 15th 05 01:12 PM


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