Good Evening,
I have a program that periodically gets stuck saving a file to a network location. I've written the following snip of code to try to prevent this from happening. The basic idea is to use the Application.OnTime feature to check and see if the program gets stuck saving a file. Unfortunately this isn't working.
Is there a better way to back out of a file save if a given time period has elapsed?
I have a program that periodically gets stuck saving a file to a network location. I've written the following snip of code to try to prevent this from happening. The basic idea is to use the Application.OnTime feature to check and see if the program gets stuck saving a file. Unfortunately this isn't working.
Is there a better way to back out of a file save if a given time period has elapsed?
VBA Code:
'Save on Q Drive
Path = "Q:\XYZ"
If Path & "Alice Data - " & Desk & ".xlsx" <> "" Then
Sheets("Control Panel").Range("A2") = "SAVING"
Kickout_Time = Now + TimeValue("00:01:00")
Application.OnTime Kickout_Time, "Kickout_1”
ActiveWorkbook.SaveAs Filename:=Path & "Alice Data - " & Desk & ".xlsx", FileFormat:=51, CreateBackup:=False
Sheets("Control Panel").Range("A2") = ""
End If