Closed Thread
Results 1 to 7 of 7

Error while establishing a connection with HP ALM server

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-29-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    101

    Error while establishing a connection with HP ALM server

    Hi Everyone,

    I am trying to build a macro which pulls the defect details from HP ALM 11.0.

    I am using Dim QCConnection As New TDAPIOLELib.TDConnection

    but when i try to run the macro its throwing an error . "Compile Error. Can't find project or library" and when I click "OK" it opens reference dialog box.

    I think i have checked all the necessary references. (attached a screenshot of the selected references)

    Can someone please help in overcoming this error and make a connection with ALM server.

    Thanks in advance.

    EXCEL_TO_ALM.jpg

  2. #2
    Forum Contributor
    Join Date
    11-29-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: Error while establishing a connection with HP ALM server

    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..!!

  3. #3
    Registered User
    Join Date
    09-12-2016
    Location
    Hydrabad
    MS-Off Ver
    2013
    Posts
    1

    Re: Error while establishing a connection with HP ALM server

    Hi,
    If a user has the “Reconnect to server on startup” selected, QTP will attempt to reconnect to the old ALM/QC server every time it’s started.
    First, you should to make sure QTP doesn’t try to reconnect to the older ALM/QC instance, since it will attempt to automatically update the QC add-in control, inevitably causing version conflicts.
    To do this, go into the mic.ini and make sure all the automatic logins values are set to 0.
    Navigate to the directory in which QuickTest Professional\bin is installed.
    Make sure the ‘ReconnectToDB’ is not selected.
    Uninstall the HP QuickTest Add-in for ALM-QC
    Under Windows’s Control Panel section, uninstall the HP QuickTest Add-in for ALM-QC.

    nstall the new ALM/QC HP Quality Center Connectivity
    Navigate to ALM/QC server Add-Ins Page (http://YourQCServer/qcbin).
    Click on the Add-Ins Page link.
    Click on the HP Quality Center Connectivity.
    Download the Add-in to your local drive. (If you’re running on Windows7, be sure to right-click on the TDConnect.exe and “Run as administrator.”
    Start QTP and try connecting to the new ALM server
    Make certain the user is using the correct Server URL. The URL should not contain start_a.htm. The correct format is: http://YourQCServer/qcbin
    If you get an error message saying WebClient.dll access is denied, and QTP is on a Windows7 machine, close QTP and right-click on the QuickTest shortcut then “Run as administrator.”


    Going Nuclear
    If the above does not resolve your issue, try the following:
    Delete the TD_80 folder (if it exists) under your Windows Temp folder.
    Uninstall the QC add-in.
    Delete the “QuickTest Add-in for…” under the Program Files\HP folder.

    Delete the registry key HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Add-in for Quality Center’
    Reboot’
    Re-install the QC add-in’
    Try again to re-connect in QTP.

  4. #4
    Registered User
    Join Date
    01-21-2025
    Location
    New York, USA
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: Error while establishing a connection with HP ALM server

    Looks like the macro gods are having a laugh at your expense! That "Can't find project or library" error usually means a missing or incorrect reference. Double-check that you've added the TDAPIOLELib reference properly in your VBA editor. If it’s still acting up, try re-registering the TDAPIOLELib.dll. Also, ensure the ALM server is reachable—sometimes it’s like bad server hosting, just not reliable. Good luck debugging!
    Last edited by AliGW; 01-21-2025 at 07:26 AM. Reason: Advertising not allowed - post redacted accordingly.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,014

    Re: Error while establishing a connection with HP ALM server

    Thank you, however you may not have noticed that the thread was started eleven years ago ...
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    01-21-2025
    Location
    New York, USA
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: Error while establishing a connection with HP ALM server

    Quote Originally Posted by AliGW View Post
    Thank you, however you may not have noticed that the thread was started eleven years ago ...
    Oops, my bad! Guess I just revived a vintage thread. Let’s call it “retro troubleshooting”!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,014

    Re: Error while establishing a connection with HP ALM server

    OK - please note that I have removed your last statement, as it is advertising, and we do not allow this. Please have a read through the forum rules before posting here again. Thank you.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Reusing server connection
    By samshut in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2007, 12:11 PM
  2. Excel VBA connection to SQL Server using ADO
    By Taolo Morake in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2005, 12:05 PM
  3. ADO Connection to SQL Server
    By mal_k100@hotmail.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2005, 08:05 AM
  4. SQL Server Connection Pooling
    By James W. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2005, 09:05 AM
  5. ADO connection problem when using server
    By Bkraska in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-18-2005, 11:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1