I have a VBA script which i want to run in the post processing section of the QC 11 Excel Reports generator (using the UI, not the API). This script uses the Dictionary object in the Microsoft.Scripting reference. When designing it in Excel, i add the reference via Tools->References.

How can this be achieved in QC?


Adding references implies early binding. But early binding is not necessary to use any component registered in the COM registry.

You can just use the CreateObject function to get back a late-bound reference to the object. It's not pretty, but it works.

You just need to know the fully qualified name of the object. I'm assuming that here it's Microsoft.Scripting.Dictionary.

So instead of

Dim x As New Dictionary (with an Early Bound Reference to Microsoft.Scripting)


Dim x As Object
Set x = CreateObject("Microsoft.Scripting.Dictionary")

This is not specific to QC/ALM, or even QA, by the way. This is a generic concept that applies in various ways to any COM-enabled programming environment, including VBA, VB6, VBScript, C++, or even .NET. See the article on early vs. late bound here.

  • Helpful. I am going to give it a test out now. As an aside, the reference is Scripting.Dictionary not Microsoft.Scripting.Dictionary Jul 23 '13 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.