Link to home
Start Free TrialLog in
Avatar of black_help
black_help

asked on

Webbrowser problems

Well I have 2 problems:

1) Those annoying javascript runtime errors.
I want to ignore them so I have the following code
Private Sub webRegister_DownloadComplete()
    On Error Resume Next
    Set objDoc = webRegister.Document
    Set objWind = objDoc.parentWindow
End Sub
Private Sub webRegister_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    On Error Resume Next
    Set objDoc = webRegister.Document
    Set objWind = objDoc.parentWindow
End Sub
Public Sub objWind_onerror(ByVal description As String, ByVal URL As String, ByVal line As Long)
    On Error Resume Next
    Set objEvent = objWind.event
    With objEvent
        .returnValue = True
    End With
End Sub

Why I put the On Error Resume Next?  Well if I debug it, I dont have any problems and everything runs fine.  When I compile it and run the *.exe I sometimes get erros.  Why? I have no idea.
Now this code only works when the user has changed the "check for script errors" in IE tools.  But I dont want that.  It has to work without any problems for the user cause it sucks when you have to tell the user what he/she has to do.
The java error I get only happens with a visual basic webbrowser, not when I use firefox or IE and check that site out.

So either I need to ignore those runtime errors or I would like to have a script that enables that specific IE option.

2) http://users.pandora.be/stofferken/stupiderror.JPG <-Since today I am getting this error
I dont remember having changed that much but I didnt get this error before.
I have no clue what it means but it has to do something with my webbrowser I think.
Anyone can explain this error and tell me how to get rid of it?

Please help

Avatar of AzraSound
AzraSound
Flag of United States of America image

1) Have you tried setting the WB Silent property to True?

2) No idea, w/o further info on where/when/how that error is occurring.
Avatar of black_help
black_help

ASKER

1) That option is basically the same as the one I am currently using, but it will force the runtime control to start by just bypassing the error message like if you had pressed "yes"
So thats not at all what I need.

2) I have no further info, thats my problem I only get this error after my program is compiled so I never get this when I debug.
I tried finding the place were this bug occurs by adding messages boxes after every line but it seems to occur @ something like form1.label1.visible = true after the webbrowser had the DownloadComplete event.
Ok, I recoded my the webbrowser part and I no longer get that second error.
I still dont know what it was but no need to bother anymore.

However my first question still stands.
How to change the IE options?
or
Is it possible to kill the (runtime check) process without the user having any knowledge about it when a javascript error would occur?
Id very much like to have an answer soon since Ive been looking for this for quite some time now.

Any solution in wich the webbrowser just continues working and the user having no knowledge about possible errors will do.
Solved it myself:
"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\Disable Script Debugger" -> "yes"

does the trick

ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

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