Disable Just-in-Time Debugging for VBScript in VB.NET

andy1

Newcomer
Joined
Jan 1, 2004
Messages
8
Hi.

I am currently making a program in Visual Basic that uses scripting in VBScript. It checks for errors as you type the script using scriptingcontrol.ExecuteStatement, but every time there is an error, the Just-in-Time Debugger pops up and asks to debug in VS.NET. How can I disable this in my program using VB code, and then enable it again when my program closes?

-=Thanks=-
 
Put a Try : Catch : End Try around the code that causes an error:
Visual Basic:
Try
    ScriptControl.ExecuteStatement(...)
Catch ex As Exception 'If an error of any type is found, handle it
    MessageBox.Show("Error, the code is invalid")
    Return
End Try
The Just-in-Time Debugger only shows when you're not handling the error yourself(ie. No Try Catch blocks around it, or no Catch statement for the error thrown).
 
Thanks for your reply, however, it still doesn't help. It just pops up Just in Time Debugging and then I close it and then it says there is an error. That's the same result I got when I tried the On Error GoTo statement.
 
Back
Top