raccoon588
Board Regular
- Joined
- Aug 5, 2016
- Messages
- 118
I have a timer on a macro to save the file every 15 minutes. If i open another excel while this one is open it triggers the other excel to save. and if i open an excel while this is running and then close it the file will reopen at the 15 minute mark and try to save. Any ideas on how to prevent this?
Code:
Sub Save1()
Dim nom As String
Dim path As String
path = ThisWorkbook.Sheets("setup-lamp types").Range("L2").Value
nom = ThisWorkbook.Name
Application.DisplayAlerts = False
ThisWorkbook.SaveAs path & "\" & nom
Application.DisplayAlerts = False
ThisWorkbook.Application.OnTime Now + TimeValue("00:15:00"), "Save1"
End Sub