3

I created a VB script that converts the Object Repository file (.tsr) of QTP to XML and then to Excel. This Excel file format is configured via the VB script as well. It works well however, I am trying to run this on a new machine and I get an error:

ActiveX component cant create object: Mercury.ObjectRepositoryUtil.

Script:

Public Function ExportTSRToXML(TSRPath,XMLPath)
Set XMLRepositoryObj = CreateObject("Mercury.ObjectRepositoryUtil")
XMLRepositoryObj.ExportToXML TSRPath, XMLPath
ExportTSRToXML = XMLPath
Set XMLRepositoryObj = Nothing
End Function

Here are my steps to fix this: 1. Registered RepositoryUtil.dll with REGSVR32 2.using CSCRIPT.exe under SYSWOW64 ran the vbscript file

At step 2 mentioned above, I see the error when the script is executed : "Microsoft VBScript runtime error: invalid procedure call or argument"

What Am i missing? Cant figure it out.

Thank you for your help. Again, this code works completely fine on multiple machines. The new Machine (64bit) has Unified Functional tool 11.5 instead of QTP 11.0.

Motti
  • 110,860
  • 49
  • 189
  • 262
user2034602
  • 51
  • 1
  • 1
  • 6

1 Answers1

1

Try to start the script from command line with: %SystemRoot%\SysWow64\cscript <yourscript-here>. The 64 bit machine automatically starts a 64 bit interpreter and this com object is not compatible with it

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
Baloo
  • 11
  • 1