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

蹲街弑〆低调 提交于 2020-08-25 07:14:20

问题


I am trying to connect to QCServer using Excel Macro. I am using a 64-bit operating system with following being done:

  1. Register OTAClient.dll
  2. Installed HP ALM Connectivity tool
  3. Added OTA Library to reference

I am getting the following error:

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

But the same is running using VBScript:

C:\Windows\SysWOW64\Wscript.exe "C:\Users****\Desktop\qcConn.vbs"


回答1:


I have found this solution on some other blog:

If you are on 64 bit 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.

So what can be done to run it, call command line prompt in your macro and run your command:

C:\Windows\SysWOW64\Wscript.exe 

C:\Users****\Desktop\qcConn.vbs 

which will call that vbs. Eg:

Dim goWS: Set goWS = CreateObject("WScript.Shell")    
sCmd = "C:\Windows\SysWOW64\Wscript.exe "C:\Users****\Desktop\qcConn.vbs"""" 
Set oExec = goWS.Exec(sCmd)

Hope this helps !!




回答2:


This is due to the COM objects issue, you need to create few Key's in Registry to run it without issues.

1) Locate your COM object (TDAPIOLE80) GUID under the HKey_Classes_Root\Wow6432Node\CLSID[GUID] Once located (in the parent folder) add a new REG_SZ (string) Value. Name should be AppID and data should be the same COM object GUID (Along with {}) you have just searched for.

2) Add a new key under HKey_Classes_Root\Wow6432Node\AppID\, the new key should be called the same as the com object GUID (Along with {})

3) Under the new key you just added, add a new string (REG_SZ) Value, and call it DllSurrogate, Leave the value empty

4) Create a new Key under HKey_Local_Machine\Software\Classes\AppID\ , Again the new key should be called the same as the COM object’s GUID (Along with {}). No values are necessary to be added under this key.

With this you should be good!!

Cheers!!




回答3:


You can also try following steps-

1.Open IE as Admin(right click on IE Run as Administrator)

2.Open ALM, Navigating by URL (your url)

3.Click on Tools link

4.Click on ALM Connectivity link (Run your download)

5.again Click on Tools

6.HP ALM Client Registration Link

4.In the pop up scroll down and select ‘Register HP ALM’

5.It’ll do some downloads. Once completed close the window

This will fix the problem.



来源:https://stackoverflow.com/questions/38701522/activex-component-cant-create-object-tdapiole80-tdconnection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!