How to Connect to HP QC using Excel VBA<\/a>. As we know, from the previous article that QC Connection is made in two parts: \n <\/p>\n1. Authentication using QC ID and Password<\/h3>\n2. Login with Domain and Project Name<\/h3>\n <\/p>\n
It is a good practice to check the Connection Object – qcConnection<\/strong><\/i> whether Authentication and Login with Domain and Project were successful before using it. \n <\/p>\nVBA Statement to check if Authentication was Successful ?<\/h3>\n\n If (QCConnection.LoggedIn <> True) Then\n MsgBox \"QC User Authentication Failed\"\n End If\n<\/code><\/pre>\nVBA Statement to check if Login with Domain and Project was Successful ?<\/h3>\n\n If (QCConnection.AuthenticationToken = \"\") Then\n MsgBox \"QC Project Failed to Login with your Domain and Project\"\n QCConnection.Disconnect\n End If\n<\/code><\/pre>\nRefer the below VBA code to connect to QC with both the checks done <\/h2>\n\nFunction ConnectToQC()\n On Error Resume Next\n Dim QCConnection\n 'Create QC Connection Object to connect to QC\n Set QCConnection = CreateObject(\"TDApiOle80.TDConnection\")\n\n Dim sUserName, sPassword, sDomain, sProject\n sUserName = \"\"\n sPassword = \"\"\n sDomain = \"\"\n sProject = \"\"\n QCConnection.InitConnectionEx \"<you URL>\"\n 'Authenticate your user ID and Password\n QCConnection.Login sUserName, sPassword\n 'Quit if QC Authentication fails\n If (QCConnection.LoggedIn <> True) Then\n MsgBox \"QC User Authentication Failed\"\n End\n End If\n 'Login to your Domain and Project\n QCConnection.Connect sDomain, sProject\n 'Quit if login fails to specified Domain and Project\n If (QCConnection.AuthenticationToken = \"\") Then\n MsgBox \"QC Project Failed to Connect to \" & sProject\n QCConnection.Disconnect\n End\n End If\n<\/code><\/pre>\n<\/span>","protected":false},"excerpt":{"rendered":"Hello Friends, This article is basically an extension to my previous article How to Connect to HP QC using Excel VBA. As we know, from the previous article that QC Connection is made in two parts: 1. Authentication using QC ID and Password 2. Login with Domain and Project Name It is […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1677],"tags":[],"class_list":["post-12185","post","type-post","status-publish","format-standard","hentry","category-hp-qc"],"yoast_head":"\n
HP Quality Center - Check if Connection to QC is made successfully ? - Let's excel in Excel<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n