{"id":12185,"date":"2013-09-18T17:45:21","date_gmt":"2013-09-18T17:45:21","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=3197"},"modified":"2022-07-25T18:08:07","modified_gmt":"2022-07-25T18:08:07","slug":"check-hp-alm-connection-using-vba","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/","title":{"rendered":"HP Quality Center – Check if Connection to QC is made successfully ?"},"content":{"rendered":"

Hello Friends,
\n 
\nThis article is basically an extension to my previous article 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>\n

1. Authentication using QC ID and Password<\/h3>\n

2. 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>\n

VBA 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>\n

VBA 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>\n

Refer 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":"\nHP Quality Center - Check if Connection to QC is made successfully ? - Let's excel in Excel<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HP Quality Center - Check if Connection to QC is made successfully ?\" \/>\n<meta property=\"og:description\" content=\"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 […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2013-09-18T17:45:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-25T18:08:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"HP Quality Center – Check if Connection to QC is made successfully ?\",\"datePublished\":\"2013-09-18T17:45:21+00:00\",\"dateModified\":\"2022-07-25T18:08:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/\"},\"wordCount\":123,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"articleSection\":[\"HP QC\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/\",\"name\":\"HP Quality Center - Check if Connection to QC is made successfully ? - Let's excel in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"datePublished\":\"2013-09-18T17:45:21+00:00\",\"dateModified\":\"2022-07-25T18:08:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HP QC\",\"item\":\"https:\/\/vmlogger.com\/excel\/hp-qc\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"HP Quality Center – Check if Connection to QC is made successfully ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"HP Quality Center - Check if Connection to QC is made successfully ? - Let's excel in Excel","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/","og_locale":"en_US","og_type":"article","og_title":"HP Quality Center - Check if Connection to QC is made successfully ?","og_description":"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 […]","og_url":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2013-09-18T17:45:21+00:00","article_modified_time":"2022-07-25T18:08:07+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/vmlogger.com_-1.png","type":"image\/png"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"HP Quality Center – Check if Connection to QC is made successfully ?","datePublished":"2013-09-18T17:45:21+00:00","dateModified":"2022-07-25T18:08:07+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/"},"wordCount":123,"commentCount":6,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"articleSection":["HP QC"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/","url":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/","name":"HP Quality Center - Check if Connection to QC is made successfully ? - Let's excel in Excel","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"datePublished":"2013-09-18T17:45:21+00:00","dateModified":"2022-07-25T18:08:07+00:00","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2013\/09\/check-hp-alm-connection-using-vba\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"HP QC","item":"https:\/\/vmlogger.com\/excel\/hp-qc\/"},{"@type":"ListItem","position":3,"name":"HP Quality Center – Check if Connection to QC is made successfully ?"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12185"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=12185"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12185\/revisions"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=12185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=12185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=12185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}