Private Sub LoginError(ProjectName As String, User As String, _ &Password As String) ' This example shows handling of the OLE ' exceptions thrown by OTA ' TDOLE_ILLEGALPASSWORD is a member of enumeration tagTDAPI_ERRORCODES On Error GoTo CheckError 'tdc is a TDConnection object tdc.ConnectProject ProjectName, User, Password Exit Sub CheckError: if (Err.Number - vbObjectError) = _ TDAPIOLELib.TDOLE_ILLEGALPASSWORD Then LoginForm.Show 1 Else MsgBox "Error: " & Err.Description, vbCritical End If End Sub