Forum Discussion

cosminsandu's avatar
cosminsandu
Occasional Contributor
13 years ago

Error: Could not convert variant of type (OleStr) into type (Dispatch)

Hi, 



I am using TC7.52 and when inspecting an array of object the following error appears:

Error: Could not convert variant of type (OleStr) into type (Dispatch)



E.g. 


function Test()

{

  var a = [ [0,0],

                [1,1],

                [2,2]]

  //inspect element

}


I've reinstalled the MS Script Debugger but the problem still persists.



How can I fix this problem.

Please note that I also use Visual Studio 2010...
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Cosmin,



    Thanks for the additional info.



    You wrote earlier that you got the "Could not convert" issue fixed:

    I've renamed C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG to VS7DEBUG2 and reinstalled MS Script Debugger to

    C:\Program Files\Microsoft Script Debugger and the TC problem was fixed


    Did the issue reappear, or am I misunderstanding something?
  • cosminsandu's avatar
    cosminsandu
    Occasional Contributor
    Hi Helen



    This problem was fixed by renaming the VS7DEBUG folder but another appears: 

    When I try to close TestComplete an error message appears:  "TestComplete has encountered a problem in module tcsriptextension.pls and needs to close. ..." (See above description)



    So I renamed C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG2 back to VS7DEBUG and I am stick with the first problem.


  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Cosmin,



    I see. Have you contacted Support to get a patch for the "problem in module tcsriptextension.pls" issue as I suggested earlier?

    >>

    When I try to close TestComplete an error message appears:

    "TestComplete has encountered a problem in module tcsriptextension.pls and needs to close. ..."

    >>



    This error was fixed in TestComplete 8.0.

    There's also a patch for TestComplete 7.52. To get the patch, please contact our Support Team and refer to this thread.




    Once you get and install the patch, please rename the VS7DEBUG folder to fix the original "Could not convert" issue.

    Let me know the results.
  • I am having same issue. I am using TC 8.7 and Visual Studio 10.

    I have reinstalled the MS script debugger but get same issue "Could not convert variant type (OleStr) to type (Dispatch) on below code:




    Dim ObjRegExp, numberStr, strObj1


      strObj1 = "12345"


      Set ObjRegExp = New RegExp


      ObjRegExp.Pattern = "\d+\.\d+"


      ObjRegExp.IgnoreCase =True


      ObjRegExp.Global =True


      Set numberStr =ObjRegExp.Execute(strObj1)


      RegExPatternSearch = numberStr(0).Value



    Can you check why this is happening? I tried the sample code you have but same issue.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Sachin,



    Have you renamed <Program Files>\Common Files\microsoft shared\VS7DEBUG\ folder (<Program Files (x86)\Common Files\microsoft shared\VS7DEBUG\ in case of 64-bit system) to something else after you closed TestComplete but before you reinstalled MS Script Debugger?