How to debug PowerDesigner VBScripts
Here is what you need to do:
- Install at least the Professional Version of Microsoft Visual Studio (it will not work using the “Express” Version).
- Enable “Just-In-Time”-Debugging. Just for the record, because this will be enabled by default when you install Visual Studio, so usually nothing to do for you 🙂
Just to be sure, you may check the registry for the following key: “HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings” => make sure the value “JITDebug” is set to “1“.
Background: Just-In-Time debugging means that whenever some VBscript is executed on your PC (i.e. not only in PowerDesigner) and it hits a breakpoint or an exception occurs, you will be asked if you like to debug it and choose a debugger. You can control the JIT debugging in Visual Studio: Extras > Options > Debugging > Just-In-Time. You might want to turn it off at least temporary, if a lot of scripts on your PC fail and you will be prompted each time to start Visual Studio.
- Simply put the statement “Stop” into your VBscript, where you like to start debugging. Then you will be prompted to start Visual Studio as soon as the execution reaches this statement.
After Visual Studio has started you can use the VS debugger to set additional breakpoints and make use of all the other debugging capabilities.”