ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   After Save Event (Interop) (https://www.excelbanter.com/excel-programming/353587-after-save-event-interop.html)

Jörgen Ahrens

After Save Event (Interop)
 
Hi All

Is there a way to get an after save event? or some workaround to do that?

thanks for your help
jahrens



Bob Phillips[_6_]

After Save Event (Interop)
 
There is a way to emulate it. Here is an example using VBA
http://tinyurl.com/748cw

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Jörgen Ahrens" wrote in message
...
Hi All

Is there a way to get an after save event? or some workaround to do that?

thanks for your help
jahrens





Jörgen Ahrens

After Save Event (Interop)
 
The Save and SaveAs work perfectly. But make a change to the workbook, then
hit Close. Obviously you are prompted to save or not, which I want. But,
if the user selects yes, the code kicks in and kind of throws the file into
a loop of prompts. I just want the "before save" to fire, then close the
workbook.

is there a way to solve that problem?


"Bob Phillips" wrote in message
...
There is a way to emulate it. Here is an example using VBA
http://tinyurl.com/748cw

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Jörgen Ahrens" wrote in message
...
Hi All

Is there a way to get an after save event? or some workaround to do that?

thanks for your help
jahrens







Jörgen Ahrens

After Save Event (Interop)
 
I have seen an interesting solution:

Inside the BeforeSave Event make a call to OnTime and pass a
procedure(Macro) that should be executed. This procedure will be executed
right after the Save.

Is there a way to catch that event before the macro is executed?

thansk for your help
jahrens



Peter Huang [MSFT]

After Save Event (Interop)
 
Hi Jahrens,

I think you may try to use the code snippet below to see if that helps you.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
ThisWorkbook.Saved = True
ThisWorkbook.SaveAs "C:\testABC.xls"
SaveAsUI = False
Cancel = True
End Sub

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.



All times are GMT +1. The time now is 11:55 AM.

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