My Bad. i didnt point the OTAClient.dll. i am not getting any reference error. But I am unable to establish a connection with ALM. can you please help me. below is my code.
Option Explicit
Dim QCConnection As New TDAPIOLELib.TDConnection
Const TOOL_NAME = "Defect Reporter"
Sub subDriver()
Dim objBugFactory As BugFactory
Dim objBugFilter, objBugList, Bug, bugField
Dim objOutputSht As Object
Dim intCol As Long, intRw As Long
Set objOutputSht = ThisWorkbook.Sheets("Result")
objOutputSht.Range("A3:IV65536").ClearContents
If QCLogin Then
Set objBugFactory = QCConnection.BugFactory
Set objBugFilter = objBugFactory.Filter
objBugFilter.Filter("BG_PROJECT") = Chr(34) & ThisWorkbook.Sheets("Home").Range("E9").Value & Chr(34)
Set objBugList = objBugFilter.NewList()
''' intCol = 1
On Error Resume Next
''' For Each bugField In objBugFactory.Fields
''' objOutputSht.Cells(1, intCol).Value = bugField.Name 'Jayender
''' intCol = intCol + 1
''' Next
intRw = 3
For Each Bug In objBugList
For intCol = 1 To objOutputSht.UsedRange.Columns.Count
objOutputSht.Cells(intRw, intCol).Value = Bug.Field(objOutputSht.Cells(2, intCol))
Next
intRw = intRw + 1
Next
MsgBox "Defect report generated successfully", vbInformation, TOOL_NAME
End If
Call QCLogout(QCConnection)
Set objOutputSht = Nothing
Set QCConnection = Nothing
End Sub
Function QCLogin() As Boolean
On Error Resume Next
Dim strURL As String
Dim strUserName As String
Dim strPassword As String
Dim strDomain As String
Dim strProject As String
'//**** Reading Input *************************
QCLogin = False
strURL = ThisWorkbook.Sheets("Home").Range("E4").Value
strUserName = ThisWorkbook.Sheets("Home").Range("E5").Value '--> Please Specify your username
strPassword = ThisWorkbook.Sheets("Home").txtPass.Value '--> Please specify your password
strDomain = UCase(ThisWorkbook.Sheets("Home").Range("E7").Value)
strProject = UCase(ThisWorkbook.Sheets("Home").Range("E8").Value)
'//**** Initial Validation *************************
If strURL = "" Then
MsgBox "Enter QC/ALM URL", vbCritical, TOOL_NAME
Exit Function
End If
If strUserName = "" Then
MsgBox "Enter QC/ALM User Name", vbCritical, TOOL_NAME
Exit Function
End If
If strDomain = "" Then
MsgBox "Enter QC/ALM Domain", vbCritical, TOOL_NAME
Exit Function
End If
'//**** Connecting to QC/ALM *************************
If QCConnection.Connected Then
QCConnection.Disconnect
End If
Err.Clear
'Connecttion to QC
QCConnection.InitConnectionEx strURL ' unable to establish connection.
If Err.Number <> 0 Then
MsgBox "QC/ALM connection failed...", vbCritical, TOOL_NAME
QCLogin = False
Exit Function
End If
QCConnection.Login strUserName, strPassword
If Err.Number <> 0 Then
MsgBox "Invalid Username or Password...", vbCritical, TOOL_NAME
QCLogin = False
Exit Function
End If
QCConnection.Connect strDomain, strProject
QCConnection.IgnoreHtmlFormat = True
If (QCConnection.Connected <> True) Then
MsgBox "QC/ALM Project connection Failed", vbCritical, TOOL_NAME
QCLogin = False
Exit Function
End If
QCLogin = True
Err.Clear
End Function
Function QCLogout(ByRef QCConnection As TDAPIOLELib.TDConnection)
On Error Resume Next
If QCConnection.Connected = True Then If QCConnection.LoggedIn = True Then QCConnection.Logout
If QCConnection.Connected = True Then QCConnection.Disconnect
QCConnection.ReleaseConnection
Set QCConnection = Nothing
Err.Clear
End Function
Private Sub txtPass_Change()
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
this line is not working.
QCConnection.InitConnectionEx strURL
Please help me..!!
Bookmarks