Select Previous Active WindowMar 25, 2009
I have multiple excel workbooks open at the same time. I need to run a macro on one of them every 15 min but I need to return to the active window when the macro is done. How do I read what window is active then return to it when the macro is done?
dTime = Now + TimeValue("00:15:00")
Application .OnTime dTime, "AutoSave"
Application.DisplayAlerts = False
ActiveWorkbook. SaveAs Filename:="c:excel" & Format(Time, "hhmmss"), FileFormat:=xlCSV
Application.DisplayAlerts = True