View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ina ina is offline
external usenet poster
 
Posts: 120
Default execute macro; save it and close using Application.OnTime

hello,

I would like to know how to save after than the macro is finished to
run; for example I have this piece of code:


......
dtmTime = Now + TimeValue("00:00:07")
Application.OnTime dtmTime, "thisworkbook.operations"


Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\test.xls", FileFormat:=xlHtml, ReadOnlyRecommended:=False,
CreateBackup:=False
Application.DisplayAlerts = True
'and there how to determinate the exact time of the end of my macro; do
you think I have the
'possibility to catch it with something else than now ().
'my macro is a little slow as need to do a lot of calculation

dtmSave = dtmTime + TimeValue("00:01:00")
Application.OnTime dtmSave, "Save_Exit"

ina