Webbrowser problems

Posted on 2006-04-12
Last Modified: 2011-10-03
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) <-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

Question by:black_help
    LVL 28

    Expert Comment

    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.

    Author Comment

    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.

    Author Comment

    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?
    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.

    Author Comment

    Solved it myself:
    "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\Disable Script Debugger" -> "yes"

    does the trick


    Accepted Solution

    Closed, 500 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now