title: Executing the test cases in alm from Excel by Test ID
body: <p>I am trying to execute the test cases in QC ALM through an Excel macro. I am able to access the tests in testlist, but I am not able to find the particular test case I need to execute by its ID.</p>
  
  <p>Below is the sample code I am using:</p>
  
  <pre><code>Set tsTreeMgr = tdConnection.testsettreemanager
  Set tsFolder = tsTreeMgr.NodeByPath(nPath)
  ' --Search for the test set passed as an argument to the example code
  Set tsList = tsFolder.FindTestSets("Test Set Name")
  
  '------Accessing the Test Cases inside the Test SEt ----
  
  Set theTestSet = tsList.Item(1)
  For Each testsetfound In tsList
      Set tsFolder = testsetfound.TestSetFolder
      Set tsTestFactory = testsetfound.tsTestFactory
      Set tsTestList = tsTestFactory.NewList("")
  
      For Each tsTest In tsTestList
          MsgBox (tsTest.Name+","+ tsTest.ID)
          testrunname = "Test Case name from excel sheet"
          '----Accesssing the Run Factory ---
          Set RunFactory = tsTest.RunFactory
          Set obj_theRun = RunFactory.AddItem(CStr(testrunname))
          obj_theRun.Status = "Passed"
          obj_theRun.Post
      Next
  Next
  </code></pre>
  
  <p>Any help to get TestCase in testset of testlab to execute would be great help. </p>