0

I am trying to connect to HPQC though vbscript in excel. I have already added the OTA library to Reference.

When I am trying to instantiate an object as TDConnection,

Global tdc As TDConnection

Set tdc = new TDConnection

its throwing an error:

Run-time error '429': ActiveX component can't create object.

I used the below code to check:

Sub Connect()

Dim tdc as TDConnection
Dim url as String
Dim Domain as String
Dim Project as String
Dim username as String
Dim Password as String
url = "http://qc.abcdef.com"
Domain = "NNNN"
Project = "NNNNNNN"
username = "ABCD"
Pasword = "XYZ"
Disconnect 'Disconnects any open connections
If (tdc Is Nothing) Then Set tdc = New TDConnection
If (tdc Is Nothing) Then GoTo ConnectionErr
tdc.InitConnectionEx url 'Initiate Connection
tdc.Login username, Password
tdc.Connect Domain, Project
MsgBox "Connection Established"
Exit Sub
ConnectionErr:
MsgBox "Connection Error"

End Sub

Then ran from cmd the below command

C:\Windows\SysWOW64> wscript.exe "C:\...\QC.vbs" 

but facing error ErrorMsg

Please help!

Community
  • 1
  • 1
Vikram
  • 65
  • 2
  • 9
  • Are you trying to use VBScript, or are you using VBA? From what I can see on wikipedia, VBScript doesn't support dimensioning variables `As` something, which is why it is giving an error pointing to the "A" in "As". – YowE3K Oct 02 '16 at 17:55

1 Answers1

0

Try running your VB script with command prompt using specific cscript -

C:\WINDOWS\SysWOW64>cscript.exe ".... .vbs"

For more info refer https://community.hpe.com/t5/Quality-Center-ALM-Practitioners/ActiveX-component-can-t-create-object-TDApiOle80-TDConnection/td-p/4742677

Techidiot
  • 1,921
  • 1
  • 15
  • 28
  • Unable to resolve the issue. I have added details above. Facing similar issue on using cscript as well. Please have a look. Thanks. – Vikram Oct 02 '16 at 12:57