01-12-2012 03:47 PM
Hi all.
I'm controlling diadem through the OLE interface and I was wondering how do I return any errors that might have been raised by a vbscript.
I need to be able to notify someone if the process failed to complete.
Here's the gist of what I'm doing.
Dim MyDiadem AsNew DIAdem.TOCommand
MyDiadem.bNoErrorDisplay =True
Dim lsuccess = MyDiadem.CmdExecuteSync("ScriptStart('MyScript.VBS')")
Thanx,
Bill.
Solved! Go to Solution.
01-13-2012 03:45 PM - edited 01-13-2012 03:48 PM
Hey punkmonkey,
I looked was looking into this question for you about basically controlling DIAdim from an OLE, in the DIAdim examples http://zone.ni.com/reference/en-XX/help/370859H-01/exploff/examples/example_ole/, it gives an example of the VB script to control DIAdem, if you want to pop up an error message if your Script hits an error in DIAdem I believe the bNoErrorDisplay = False will cause a error popup if DIAdem encounters an error.
01-16-2012 03:03 PM
Hi Bill,
I'd recommend that you save the error message (Err.Description, Err.Number) to global DIAdem variables in the VBScript and read them off with the calling language that initiated the ActiveX connection. You will only be able to access the Err object properties when you have On Error Resume Next enabled. I recommend you bracket error-likely code with On Error Resume Next and On Error Goto 0 in the called VBScript.
Brad Turpin
DIAdem Product Support Engineer
National Instruments