简体   繁体   English

ActiveX 组件无法创建对象:'TDApiOle80.TDConnection'

[英]ActiveX component can't create object: 'TDApiOle80.TDConnection'

I am trying to connect to QCServer using Excel Macro.我正在尝试使用 Excel 宏连接到 QCServer。 I am using a 64-bit operating system with following being done:我正在使用 64 位操作系统并完成以下操作:

  1. Register OTAClient.dll注册OTAClient.dll
  2. Installed HP ALM Connectivity tool已安装的 HP ALM 连接工具
  3. Added OTA Library to reference添加了 OTA 库以供参考

I am getting the following error:我收到以下错误:

ActiveX component can't create object: 'TDApiOle80.TDConnection' ActiveX 组件无法创建对象:'TDApiOle80.TDConnection'

Qc连接错误

But the same is running using VBScript:但是使用 VBScript 也是一样的:

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

脚本

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 .如果您使用的是 64 位机器,默认情况下您的脚本将使用 64 位版本的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 .但是 QC 是一个 32 位应用程序,因此您需要从位于c:\\Windows\\SysWOW64\\wscript.exewscript.exe的 32 位版本中使用它。

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.这将调用该 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 !!希望这有帮助!!

This is due to the COM objects issue, you need to create few Key's in Registry to run it without issues.这是由于 COM 对象问题,您需要在注册表中创建几个键才能正常运行它。

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. 1) 在 HKey_Classes_Root\\Wow6432Node\\CLSID[GUID] 下找到您的 COM 对象 (TDAPIOLE80) GUID 一旦找到(在父文件夹中),添加一个新的 REG_SZ(字符串)值。 Name should be AppID and data should be the same COM object GUID (Along with {}) you have just searched for.名称应为 AppID,数据应为您刚刚搜索的相同 COM 对象 GUID(连同 {})。

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 {}) 2)在HKey_Classes_Root\\Wow6432Node\\AppID\\下添加一个新的key,新的key应该和com对象的GUID一样(连同{})

3) Under the new key you just added, add a new string (REG_SZ) Value, and call it DllSurrogate, Leave the value empty 3)在刚刚添加的新键下,添加一个新的字符串(REG_SZ)值,并命名为DllSurrogate,将该值留空

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 {}). 4) 在 HKey_Local_Machine\\Software\\Classes\\AppID\\ 下创建一个新的密钥,同样,新的密钥应该与 COM 对象的 GUID 名称相同(以及 {})。 No values are necessary to be added under this key.无需在此键下添加任何值。

With this you should be good!!有了这个你应该很好!

Cheers!!干杯!!

You can also try following steps-您也可以尝试以下步骤-

1.Open IE as Admin(right click on IE Run as Administrator) 1.以管理员身份打开IE(右键IE以管理员身份运行)

2.Open ALM, Navigating by URL (your url) 2.打开ALM,按URL导航(您的URL)

3.Click on Tools link 3.点击工具链接

4.Click on ALM Connectivity link (Run your download) 4.单击 ALM Connectivity 链接(运行您的下载)

5.again Click on Tools 5.再次点击工具

6.HP ALM Client Registration Link 6.HP ALM 客户端注册链接

4.In the pop up scroll down and select 'Register HP ALM' 4.在弹出窗口中向下滚动并选择“注册 HP ALM”

5.It'll do some downloads. 5.它会做一些下载。 Once completed close the window完成后关闭窗口

This will fix the problem.这将解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM