ActiveX component can't create object: 'TDApiOle80.TDConnection' (18588 Views)
Reply
Occasional Advisor
MC Leo
Posts: 10
Registered: ‎01-21-2011
Message 1 of 20 (18,588 Views)

ActiveX component can't create object: 'TDApiOle80.TDConnection'

I have a script (vbs file) that I'm trying to execute to extract testcases from QC into excel and encountered an error.

Microsoft VBScript runtime error: ActiveX component can't create object: 'TDApiOle80.TDConnection'

The script used was from other forum where someone had posted it.
I am using QC10.0 and Windows 7 64-bit.

Any assistance is appreciated.

Occasional Visitor
pullareddy
Posts: 2
Registered: ‎01-18-2011
Message 2 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Hi MC Leo,
there are two possible reasons for ActiveX component can't create object: 'TDApiOle80.TDConnection'
one is you don't have admin rights for your application folder

and second one is your OTAClient.dll is not dowloaded properly
Valued Contributor
Alex Shnayder
Posts: 41
Registered: ‎02-10-2010
Message 3 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

This can be related to how you are running your script.

If you are on 64bit machine, by default your script will run with the 64 bit version of wscript.exe. But QC is a 32 bit app, so you need to consume it from a 32 bit version of wscript.exe which is located at c:\Windows\SysWOW64\wscript.exe.

use command line to run the script with c:\Windows\SysWOW64\wscript.exe and it should work.
Occasional Advisor
MC Leo
Posts: 10
Registered: ‎01-21-2011
Message 4 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Alex,
Can you give me the steps I need to perform inorder to run the vbs script?

Also, is it the wscript.exe or is it cscript.exe?

Will it work if I copy the wscript.exe (or cscript.exe) into the system32 folder from sysWOW64 folder?

I tried the start-run and put the following:
c:\Windows\SysWOW64\wscript.exe QC.vbs
should this work?

Thanks
Occasional Advisor
MC Leo
Posts: 10
Registered: ‎01-21-2011
Message 5 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

pullareddy,
I am the admin on my computer and also gave admin rights to prgram files (x86) folder.

Also, I checked the OTAClient.dll and it is located in program files (x86) under Mercury Interactive folder.

any other suggestion?

thanks
Honored Contributor
Sperk
Posts: 933
Registered: ‎04-22-2009
Message 6 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

You might want to check you have the necessary reference selected. I extract tests from QC to Excel OK. See attached for the references which can be accessed from the VBA code window by selecting Tools > Referneces.

Mark Smith.
Occasional Advisor
MC Leo
Posts: 10
Registered: ‎01-21-2011
Message 7 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Mark,

I checked all seem to be same as in your attachment.

Still unable to connect and extract into excel from QC.

Thanks
Honored Contributor
Sperk
Posts: 933
Registered: ‎04-22-2009
Message 8 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Not sure why you are using the create object but did you know in Excel you can use the API by declaring the objects like:

Public TDC As New TDConnection
Public recSet As Recordset
Public TSTestFact As TSTestFactory
Public theTSTest As TSTest

Then to connect:

TDC.InitConnectionEx qcServer
TDC.Login qcUser, qcPassword
TDC.Connect qcDomain, qcProject

Then to extract:

Set TSTestFact = TDC.TestFactory
Set myFilter = TSTestFact.Filter
myFilter.Filter("TS_SUBJECT") = "^" & dcTestFolder & "^"
Set tlist = myFilter.NewList

For Each Test In tlist
etc
etc


MArk Smith.
Occasional Advisor
MC Leo
Posts: 10
Registered: ‎01-21-2011
Message 9 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

This is what I am using in the VBScript

Dim objQCConnection
'Return the TDConnection object
'Set objQCConnection = New TDApioleLib.TDConnection
'Set objQCConnection = New TDConnection
Set objQCConnection = CreateObject("TDApiOle80.TDConnection")

Dim sUserName, sPassword
sUserName = "username" '<-- Change me.
sPassword = "password" '<-- Change me.

objQCConnection.InitConnectionEx "serverpath" '<-- Change me.
objQCConnection.Login sUserName, sPassword

If (objQCConnection.LoggedIn <> True) Then
MsgBox "QC User Authentication Failed"
WScript.Quit
End If

Dim sDomain, sProject
sDomain = "domainname" '<-- Change me.
sProject = "projectname" '<-- Change me.

objQCConnection.Connect sDomain, sProject

If (objQCConnection.Connected <> True) Then
MsgBox "QC Project Failed to Connect to " & sProject
WScript.Quit
End If

Call ExportTestCases("Subject\...") '<-- Change me.
Call ExportDefects()

objQCConnection.Disconnect
objQCConnection.Logout
objQCConnection.ReleaseConnection

Again, I am using QC10.0 on Windows 7 64-bit
Occasional Advisor
MC Leo
Posts: 10
Registered: ‎01-21-2011
Message 10 of 20 (18,485 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'


Do I need to have Visual Studio installed on my computer to execute a ".vbs" file?

Also, the way I currently execute the .vbs file is just by double clicking on it and that's when I get the error.
The vbs file is located on my desktop.
Honored Contributor
Sperk
Posts: 933
Registered: ‎04-22-2009
Message 11 of 20 (18,476 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

No need to have Visual Studio to execute VBS files, you only need MS script which is usually loaded with the OS as CScript.exe into C:\Windows\System32.

Is there any reason why you are running from a VBS file rather than Excel. I usually extract QC info into Excel from Excel itsself using VBA.

If it doesn't matter how its extracted email me on my profile email address and I'll send you a simple extract. This may get round your problem.

One thing to note, I have had the odd problem executing VBS files from the desktop that disappeared when I ran the VBS from say C: Drive.

Mark Smith.
Occasional Visitor
AnotherALMAdmin
Posts: 1
Registered: ‎07-10-2012
Message 12 of 20 (17,056 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

What you need to do is call the 32 bit script host from the command line, like the below example.  This will run your script from Windows 7.

 

So open a command prompt, type the path and executable for the 32-bit script host, and then the path and filename for your script in double-quotes:

 

C:\>c:\Windows\SysWOW64\wscript.exe "C:\QC_TEST_EXPORT(v20111116).vbs"

Advisor
5hippers
Posts: 19
Registered: ‎10-24-2012
Message 13 of 20 (15,892 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Hi I am trying to run this script on windows 7.  I have run it in the shell as per this thread but am encountering the following error:

 

"Execution of the Windows Host Script Failed. (Not enough storage is available to complete this operation.)

 

 

I have admin rights and I have tried running this on my c:\ drive and network drive.  The output should be approx 200kb.

 

Has anybody else had this problem?

Advisor
5hippers
Posts: 19
Registered: ‎10-24-2012
Message 14 of 20 (15,822 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Anybody on Windows 7 with this issue?

 

I changed the shell from wscript.exe to cscript.exe and it runs without an error but does not generate the file or any error messages.

Visitor
Sheeba Sasidharan
Posts: 3
Registered: ‎08-01-2008
Message 15 of 20 (14,843 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Were you able to resolve the issue?

Please share

Occasional Visitor
pmosca
Posts: 1
Registered: ‎07-09-2013
Message 16 of 20 (11,411 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

I have come across the same error code in Win 7 x64 and TRIM but different message.

 

ActiveX component cant create object: 'TRIMSDK.Databases' Code: 800A01AD

 

I cant find any other posts with exactly the same error, has anyone else seen this?

 

 

Occasional Visitor
SasKiya
Posts: 1
Registered: ‎09-06-2013
Message 17 of 20 (10,079 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

[ Edited ]

Hi Mark,

I m also using excel VBA to exact test case from QC. But it showed the message that "ActiveX component can't create object with 429 error". Please help me to understand what the issue would be.

 

Saskiya.


Sperk wrote:
No need to have Visual Studio to execute VBS files, you only need MS script which is usually loaded with the OS as CScript.exe into C:\Windows\System32.

Is there any reason why you are running from a VBS file rather than Excel. I usually extract QC info into Excel from Excel itsself using VBA.

If it doesn't matter how its extracted email me on my profile email address and I'll send you a simple extract. This may get round your problem.

One thing to note, I have had the odd problem executing VBS files from the desktop that disappeared when I ran the VBS from say C: Drive.

Mark Smith.

Sperk wrote:
No need to have Visual Studio to execute VBS files, you only need MS script which is usually loaded with the OS as CScript.exe into C:\Windows\System32.

Is there any reason why you are running from a VBS file rather than Excel. I usually extract QC info into Excel from Excel itsself using VBA.

If it doesn't matter how its extracted email me on my profile email address and I'll send you a simple extract. This may get round your problem.

One thing to note, I have had the odd problem executing VBS files from the desktop that disappeared when I ran the VBS from say C: Drive.

Mark Smith.

Sperk wrote:
No need to have Visual Studio to execute VBS files, you only need MS script which is usually loaded with the OS as CScript.exe into C:\Windows\System32.

Is there any reason why you are running from a VBS file rather than Excel. I usually extract QC info into Excel from Excel itsself using VBA.

If it doesn't matter how its extracted email me on my profile email address and I'll send you a simple extract. This may get round your problem.

One thing to note, I have had the odd problem executing VBS files from the desktop that disappeared when I ran the VBS from say C: Drive.

Mark Smith.

Sperk wrote:
No need to have Visual Studio to execute VBS files, you only need MS script which is usually loaded with the OS as CScript.exe into C:\Windows\System32.

Is there any reason why you are running from a VBS file rather than Excel. I usually extract QC info into Excel from Excel itsself using VBA.

If it doesn't matter how its extracted email me on my profile email address and I'll send you a simple extract. This may get round your problem.

One thing to note, I have had the odd problem executing VBS files from the desktop that disappeared when I ran the VBS from say C: Drive.

Mark Smith.

Sperk wrote:
No need to have Visual Studio to execute VBS files, you only need MS script which is usually loaded with the OS as CScript.exe into C:\Windows\System32.

Is there any reason why you are running from a VBS file rather than Excel. I usually extract QC info into Excel from Excel itsself using VBA.

If it doesn't matter how its extracted email me on my profile email address and I'll send you a simple extract. This may get round your problem.

One thing to note, I have had the odd problem executing VBS files from the desktop that disappeared when I ran the VBS from say C: Drive.

Mark Smith.

Sperk wrote:
No need to have Visual Studio to execute VBS files, you only need MS script which is usually loaded with the OS as CScript.exe into C:\Windows\System32.

Is there any reason why you are running from a VBS file rather than Excel. I usually extract QC info into Excel from Excel itsself using VBA.

If it doesn't matter how its extracted email me on my profile email address and I'll send you a simple extract. This may get round your problem.

One thing to note, I have had the odd problem executing VBS files from the desktop that disappeared when I ran the VBS from say C: Drive.

Mark Smith.








Occasional Visitor
dimon95
Posts: 1
Registered: ‎09-10-2013
Message 18 of 20 (10,014 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

C:\WINDOWS\SysWOW64>cscript.exe ".... .vbs" workaround works if it's a simple standalone Vbscript. We have a problem because we have a small front-end ASP/HTML app that uses pure VBScript to connect to our instance of ALM. Now that the server hosting this app is 64-bit and we're getting Active X cant createobject on the statement Set tdc = CreateObject("TDApiOle80.TDConnection") , is there any solution for this situation when VBscript is embedded in ASP? 

Occasional Visitor
ShubhamAgarwal
Posts: 1
Registered: ‎04-07-2014
Message 19 of 20 (5,732 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Hi All,

I am using ALM 11.0 and want to extract results or pdf from alm through OTA.

when i am running the vbs script it is showing the same error 800A0401,expected end of statement.

Please help me to fix this problem.

Thanks in advance.

Advisor
shivananda_S
Posts: 17
Registered: ‎02-12-2014
Message 20 of 20 (2,859 Views)

Re: ActiveX component can't create object: 'TDApiOle80.TDConnection'

Hi All,

 

Am also getting same error "ActiveX component can't create object" when run ota using excel vba.

Please help me to rectify this error.

am using windows 7 64 bit system.

 

Thanks

Shiva

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.