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.
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.
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" <heski.27zt8y_1147938300.7393@excelforum-nospam.com> a écrit dans le
message de news: heski.27zt8y_1147938300.7393@excelforum-nospam.com...
>
> 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
>
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
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks