VBA IE Automation - Handling IE errors

Sthrncali

Board Regular
Joined
Apr 1, 2011
Messages
226
Hello there -

I am having difficulties with handling IE errors to prevent manual intervention when a webpage throws an error.

My code to engage IE is:

'ASSIGN ARRAY POSITION USING IE(Counter)
Set IE(CounterMax) = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
Application.Wait 2
With IE(CounterMax)
.Visible = True
.Navigate BookLink
End With

My VBA routine cycles through a list of URL links, loads the pages, and transfers information across. The pages are loaded in groups of 10, and the cycle repeats itself until it has worked through all links in the list.

The issue is occasionally I get an IE error "The webpage has stopped responding, or something along those lines" and it requires the user to click "Close" on the error prompt before the VBA code will continue. Another error that occasionally occurs is: Microsoft Excel is waiting on another OLE action" and that as well requires the user to click "ok" in order for the process to continue.

I am hoping to find a setting in VBA that will suppress those messages so as to allow the code to continue without trying to deal with this via a timer & send keys.

I have tried things like:

Application.IgnoreRemoteRequests = False
Application.DisplayAlerts = False

Is there something else I am not thinking of that might prevent IE from displaying those prompts and hanging the process up until the user clicks on the dialog box?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top