From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Catching an error on a single line

Is there a way to catch an error on a single line in a VBS script? From what I understand the "On Error Resume Next" will apply to all lines in a procedure.
 
George
0 Kudos
Message 1 of 2
(3,047 Views)
Hello George,



unfortunaly there is no way in VBS like the On Error Goto xxx in VB/VBA. You have to encapsulate the crtitcal lines with a On Error Resume Next/On Error Goto 0 pair and find an error with if Err.Number <> 0 then after every line and handle it e.g. with a Exit Sub call.



Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
Message 2 of 2
(3,031 Views)