I am trying to test whether or a certain file is open already, and if it is closed I am saving data to it. For some reason, my code was working just fine and randomly it stopped working and giving me the message "Sub or Function not defined". I don't understand why it suddenly stopped working when I don't believe I changed anything.
CODE:
'OPEN- SCHEDULE RECHECK
If FileAlreadyOpen(FilePath) = True Then
Application.OnTime Now +TimeValue("00:00:05"), "TransferData"
Worksheets("ASCE").TransferData_Click.Enabled = False
Worksheets("ASCE").TransferData_Click.Caption = "Saving... Please wait"
It says FileAlreadyOpen is not defined, but I don't understand why it worked before and not now.
Any help is greatly appreciated.
CODE:
'OPEN- SCHEDULE RECHECK
If FileAlreadyOpen(FilePath) = True Then
Application.OnTime Now +TimeValue("00:00:05"), "TransferData"
Worksheets("ASCE").TransferData_Click.Enabled = False
Worksheets("ASCE").TransferData_Click.Caption = "Saving... Please wait"
It says FileAlreadyOpen is not defined, but I don't understand why it worked before and not now.
Any help is greatly appreciated.