Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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)

use

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.

share|improve this answer
    
Helpful. I am going to give it a test out now. As an aside, the reference is Scripting.Dictionary not Microsoft.Scripting.Dictionary –  David Colwell Jul 23 '13 at 23:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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