280                 Keysight E4980A/AL Precision LCR Meter 
Sample Program
Set Up Measurement Conditions and LCD Display
9-
ErrorHandler:
    ' Display the error message
    MsgBox "*** Error : " + Error$, MB_ICON_EXCLAMATION
    End
End Sub
    '===================================
    ' ErrorCheck
    '===================================
Sub ErrorCheck(ErrorStatus As Long)
    Dim strVisaErr As String * 500
    '
    ' Check if VISA Error
    '
    If ErrorStatus <> VI_SUCCESS Then
        Call viStatusDesc(defrm, ErrorStatus, strVisaErr)
        MsgBox "*** Error : " + strVisaErr
    End If
 
End Sub
    '===================================
    ' SelectLCR
    '===================================
Sub selectLCR(defrm As Long, AgtE4980A/AL As Long)
    Dim Lcr As String
    Lcr = Worksheets("ControlPanel").Range("B3").Value
        If Lcr = "GPIB" Then
        ErrorCheck viOpen(defrm, "GPIB0::17::INSTR", 0, 0, 
AgtE4980A/AL)