LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default After save event

Hi,

You can use an OnTime event to fire a macro after the
save, but you do need to ensure the save has actually
taken place. E.g.:

In a normal module:

Sub AfterTheSave()
If Thisworkbook.Saved=True then
Msgbox "Saved, or at least not modified since last save"
Else
Msgbox "Not saved!"
End If
End Sub

In the Thisworkbook module:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,
Cancel As Boolean)
Application.OnTime Now, "AfterTheSave"
End Sub

Regards,

Jan Karel Pieterse
Excel TA/MVP

-----Original Message-----
Hi,
I want to execute some code just after the user saved the
file. In excel97 I could not find something like an
AfterSave event (although a BeforeSave exsist).
Anybody any ideas?

Thanks


.

 
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
Timer event dhstein Excel Discussion (Misc queries) 2 June 18th 09 04:16 PM
event vba irosh Excel Worksheet Functions 4 November 11th 08 09:25 AM
VBA Event Steve Excel Discussion (Misc queries) 2 October 14th 08 11:04 PM
event marker68 Excel Discussion (Misc queries) 1 April 4th 08 02:38 PM
Save As - Before Save Event, VB, another name Danny Excel Worksheet Functions 0 March 15th 07 05:57 PM


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