VBA - AfterSave event

VBA - AfterSave event

Post by David Cana » Sat, 12 Jun 2004 14:51:11


Is there an AfterSave event? I want to include a set of VBA code to be
executed automatically every time after the workbook is saved. I have some
experience programming in VBA for Excel, I found a BeforeSave event, but not
an AfterSave, how could I create it? Thanks, Alfredo
 
 
 

VBA - AfterSave event

Post by Frank Kabe » Sat, 12 Jun 2004 14:58:01

Hi David
there's no AfterSave event but you could use the Before_Save event. Try
for example:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
application.enableevents=false
me.save
application.enableevents=True
'now your code for the after save part

Cancel=True
End Sub

 
 
 

VBA - AfterSave event

Post by Rob van Ge » Sat, 12 Jun 2004 18:59:55

I have an AfterSave example on my website. It can handle Save As...
It's in the section: Save Changes?


--
Rob van Gelder - http://www.yqcomputer.com/




not