DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the OLE to return scripting errors?

Solved!
Go to solution

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.

0 Kudos
Message 1 of 3
(4,146 Views)

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.

http://zone.ni.com/reference/en-XX/help/370859H-01/ole/ole_applications_methodsattributs/bnoerrordis...

 

BeauH
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(4,129 Views)
Solution
Accepted by topic author punkmonkey

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

0 Kudos
Message 3 of 3
(4,112 Views)