ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   After Save (https://www.excelbanter.com/excel-programming/412255-after-save.html)

steven

After Save
 
I have used Before Save code but is there a way to do After Save code?


Thank you,

Steven

Bob Phillips

After Save
 
Caters for both Save and SaveAs

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim sFile
Application.EnableEvents = False
'<Optional - this would be before save code
Cancel = True
If SaveAsUI Then
sFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If sFile < False Then
ThisWorkbook.SaveAs sFile
'<Optional - this would be after save code
End If
Else
ThisWorkbook.Save
'<Optional - this would be after save code
End If
Application.EnableEvents = True
End Sub


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Steven" wrote in message
...
I have used Before Save code but is there a way to do After Save code?


Thank you,

Steven





All times are GMT +1. The time now is 08:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com