DonChristie
04-09-2008, 03:07 PM
I have an Excel sheet that uses VBA to open another sheet and read data from it every 5 minutes. The logic is essentially this:
On Error goto whatever
Open the other sheet
return success
whatever:
return failure
If success, reset the timer for 5 minutes.
If failure, reset the timer to try again in 30 seconds.
The reason we might not be able to open the sheet is because it is being written to periodically by another application. If we're trying to read when that's happening, we'll get an error.
This logic works fine if the other sheet we're trying to open is on a local drive. However, it needs to work with the other sheet on a network drive. The problem is, when we get a failure opening the sheet on a network drive, an Excel dialog box pops up displaying the error. (don't get this message when sheet is on a local drive) Our sheet/VBA is essentially locked up until somebody presses "OK" to close that dialog box.
Is there some error handling setting I can change to get around this problem?
I'm running Excel from Office 2007, and XP Pro.
On Error goto whatever
Open the other sheet
return success
whatever:
return failure
If success, reset the timer for 5 minutes.
If failure, reset the timer to try again in 30 seconds.
The reason we might not be able to open the sheet is because it is being written to periodically by another application. If we're trying to read when that's happening, we'll get an error.
This logic works fine if the other sheet we're trying to open is on a local drive. However, it needs to work with the other sheet on a network drive. The problem is, when we get a failure opening the sheet on a network drive, an Excel dialog box pops up displaying the error. (don't get this message when sheet is on a local drive) Our sheet/VBA is essentially locked up until somebody presses "OK" to close that dialog box.
Is there some error handling setting I can change to get around this problem?
I'm running Excel from Office 2007, and XP Pro.