Link to home
Start Free TrialLog in
Avatar of fred12
fred12

asked on

controling webbrowser control error messages

When the vb5's webbrowser control generates error messages,
such as err 401 url not found, I want to either disable them or intercept them and force an 'ok'  click  or close then automatically . How can this be done. These messages are modal and lock all other processes within my app.
Please post comment only, unless you have true solution
including code/example as I am new to this.  
thanks in advance for your effort. fred.

Avatar of ndnet
ndnet

Just put the following line of code at the beginning of each Sub

On Error Resume Next


This will skip the error messages.
Avatar of fred12

ASKER

ndnet sorry, this does not prevent error messages generated within the webbrowser control, thanks anyway.
Sorry, Fred, but I do not think that you can.  The Web Browser control is simply a wrapper around Internet Explorer's OLE model.  The OCX will not allow you to supress error messages.

The only way that you might be able to do it is by subclassing IE, but I do not think that it would be worth your time.

If you need more control over the browser, you might want to consider a third-party control that will allow you to do this.
I think this can help you out

on error goto ErrLabel

ErrLabel:
msgbox err.number & err.description,vbOkOnly

ASKER CERTIFIED SOLUTION
Avatar of clifABB
clifABB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
zsi:
Silent does allow you to supress error messages.

sirigere:
WebBrowser does not produce trappable errors.
clif.

That must have been introduced in IE4, which I am not running.  I guess it is time to upgrade...  :)
Avatar of fred12

ASKER

excellent cliffabb