leeksleeks
Board Regular
- Joined
- Oct 31, 2013
- Messages
- 96
Hi,
I am wanting to use error handling in some code i have written but am unsure of how to do so. Basically I am importing webpages into excel using the unique numbers associated at the end of the webaddress. When it is trying to import a webpage with a number that doesn't exist I get Run-time error '1004' and the message The internet site reports that the item you requested could not be found. In the code it highlights .Refresh BackgroundQuery:=False.
Basically what I want is an error handler code that when a Runtime 1004 error occurs it does the following:
Application.DisplayAlerts = False
Sheets("Scorecard").Delete
Sheets("Comparison").Delete
Application.DisplayAlerts = True
Next i
Any help you can provide will be greatly appreciated.
Cheers
I am wanting to use error handling in some code i have written but am unsure of how to do so. Basically I am importing webpages into excel using the unique numbers associated at the end of the webaddress. When it is trying to import a webpage with a number that doesn't exist I get Run-time error '1004' and the message The internet site reports that the item you requested could not be found. In the code it highlights .Refresh BackgroundQuery:=False.
Basically what I want is an error handler code that when a Runtime 1004 error occurs it does the following:
Application.DisplayAlerts = False
Sheets("Scorecard").Delete
Sheets("Comparison").Delete
Application.DisplayAlerts = True
Next i
Any help you can provide will be greatly appreciated.
Cheers