![]() |
the first event that occurs after a file is done saving?
Hello all,
What is the first event that occurs immediately after a workbook is done saving? There is a Before_Save event, but there is no After_Save event. I have a file that takes a while to save to the server. I wanted to time how long it takes to save. I thought about putting "Activecell = Now()" in the Before_Save event, then activate the cell below it. Then when it is done saving, put "Activecell = Now()" in the appropriate event procedure, but I don't know what that is. If anyone has a better way of doing this or any other suggestions, I'm all ears -- Thanks for any help anyone can provide, Conan Kelly |
the first event that occurs after a file is done saving?
hi,
try something like this. just change the file path to your file path. Sub macTimer() ' Macro written 11/8/2006 by FSt1 Range("A1").FormulaR1C1 = "=NOW()" Range("A1").NumberFormat = "h:mm:ss" ActiveWorkbook.SaveAs Filename:= _ "C:YourFilePathGoesHere\deleteme.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False Range("B1").FormulaR1C1 = "=NOW()" Range("B1").NumberFormat = "h:mm:ss" End Sub regards FSt1 "Conan Kelly" wrote: Hello all, What is the first event that occurs immediately after a workbook is done saving? There is a Before_Save event, but there is no After_Save event. I have a file that takes a while to save to the server. I wanted to time how long it takes to save. I thought about putting "Activecell = Now()" in the Before_Save event, then activate the cell below it. Then when it is done saving, put "Activecell = Now()" in the appropriate event procedure, but I don't know what that is. If anyone has a better way of doing this or any other suggestions, I'm all ears -- Thanks for any help anyone can provide, Conan Kelly |
the first event that occurs after a file is done saving?
In your sub routine you could use:
Activecell = Now() ThisWorkBook.Save Activecell.Offset(1,0) = Now() -- Best wishes, Jim "Conan Kelly" wrote: Hello all, What is the first event that occurs immediately after a workbook is done saving? There is a Before_Save event, but there is no After_Save event. I have a file that takes a while to save to the server. I wanted to time how long it takes to save. I thought about putting "Activecell = Now()" in the Before_Save event, then activate the cell below it. Then when it is done saving, put "Activecell = Now()" in the appropriate event procedure, but I don't know what that is. If anyone has a better way of doing this or any other suggestions, I'm all ears -- Thanks for any help anyone can provide, Conan Kelly |
the first event that occurs after a file is done saving?
Use BeforeSave
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim nTime As Double Application.EnableEvents = False Cancel = True nTime = Now ThisWorkbook.Save MsgBox Now - nTime Application.EnableEvents = True End Sub -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "Conan Kelly" <CTBarbarin at msn dot com wrote in message ... Hello all, What is the first event that occurs immediately after a workbook is done saving? There is a Before_Save event, but there is no After_Save event. I have a file that takes a while to save to the server. I wanted to time how long it takes to save. I thought about putting "Activecell = Now()" in the Before_Save event, then activate the cell below it. Then when it is done saving, put "Activecell = Now()" in the appropriate event procedure, but I don't know what that is. If anyone has a better way of doing this or any other suggestions, I'm all ears -- Thanks for any help anyone can provide, Conan Kelly |
the first event that occurs after a file is done saving?
Jim,
Thank you for your help. After some thinking (before anyone replied) I came up with something similar in its own sub procedure. (0:01:09 to save to the old server, 0:00:08 - 0:00:09 to save to the new server) Thanks again for the feedback. Conan "Jim Jackson" wrote in message ... In your sub routine you could use: Activecell = Now() ThisWorkBook.Save Activecell.Offset(1,0) = Now() -- Best wishes, Jim "Conan Kelly" wrote: Hello all, What is the first event that occurs immediately after a workbook is done saving? There is a Before_Save event, but there is no After_Save event. I have a file that takes a while to save to the server. I wanted to time how long it takes to save. I thought about putting "Activecell = Now()" in the Before_Save event, then activate the cell below it. Then when it is done saving, put "Activecell = Now()" in the appropriate event procedure, but I don't know what that is. If anyone has a better way of doing this or any other suggestions, I'm all ears -- Thanks for any help anyone can provide, Conan Kelly |
the first event that occurs after a file is done saving?
I'm glad you got it worked out. I realized when I saw FSt1's reply that I
left out the cell formatting to show the seconds. Sometimes, when one tried to answer before anyone else, things get left out. Best wishes, Jim -- Best wishes, Jim "Conan Kelly" wrote: Jim, Thank you for your help. After some thinking (before anyone replied) I came up with something similar in its own sub procedure. (0:01:09 to save to the old server, 0:00:08 - 0:00:09 to save to the new server) Thanks again for the feedback. Conan "Jim Jackson" wrote in message ... In your sub routine you could use: Activecell = Now() ThisWorkBook.Save Activecell.Offset(1,0) = Now() -- Best wishes, Jim "Conan Kelly" wrote: Hello all, What is the first event that occurs immediately after a workbook is done saving? There is a Before_Save event, but there is no After_Save event. I have a file that takes a while to save to the server. I wanted to time how long it takes to save. I thought about putting "Activecell = Now()" in the Before_Save event, then activate the cell below it. Then when it is done saving, put "Activecell = Now()" in the appropriate event procedure, but I don't know what that is. If anyone has a better way of doing this or any other suggestions, I'm all ears -- Thanks for any help anyone can provide, Conan Kelly |
All times are GMT +1. The time now is 11:32 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com