Hi,
I have an excel where each time after the user bring it up, he or she would click in a button that call the procedure refresh().
On the excel, I have a workbook connection that import "test.csv" into a worksheet. While "test.csv" is being downloaded from the server on every 10 minute interval - there are occasion the refresh() procedure is being run at the same time the "test.csv" is still being downloaded causing the excel to throw error message "Someone else is working in "test.csv" right now. Please try again later".
How can I handle the error so that:
1) it would not throw the error message
2) try to import again in say 5 mins later
3) if 15 mins later or 3 tries later, excel still unable to import the file, then throw and error message "We tried to import test.csv for the 15 mins but are still unable to import the file."
Thank you!
I have an excel where each time after the user bring it up, he or she would click in a button that call the procedure refresh().
Code:
Sub refresh()
ThisWorkbook.RefreshAll
Call timer
End Sub
Sub timer()
Application.OnTime Now + TimeValue("00:10:00"), "refresh"
End Sub
On the excel, I have a workbook connection that import "test.csv" into a worksheet. While "test.csv" is being downloaded from the server on every 10 minute interval - there are occasion the refresh() procedure is being run at the same time the "test.csv" is still being downloaded causing the excel to throw error message "Someone else is working in "test.csv" right now. Please try again later".
How can I handle the error so that:
1) it would not throw the error message
2) try to import again in say 5 mins later
3) if 15 mins later or 3 tries later, excel still unable to import the file, then throw and error message "We tried to import test.csv for the 15 mins but are still unable to import the file."
Thank you!