I am trying to connect to QCServer using Excel Macro. I am using a 64-bit operating system with following being done:
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"
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 !!