Forum Discussion

mcastellanos's avatar
mcastellanos
Occasional Contributor
9 years ago
Solved

How to use a variable in WinFormsObject() in VBScript?

I want to pass a parameter to below line for "txtPatterName" but TC complete fails to evaluate. myparam = "txtPatterName"   Set Obj = Sys.Process("GemCat_Gui").WinFormsObject("frmPatternMetaDat...
  • HKosova's avatar
    9 years ago

    Hi mcastellanos,

     

    You need to change
    WinFormsObject(" & myparam & ")
    to
    WinFormsObject(myparam)

     

    It doesn't need quotes and concatenation because myparam is already a string.

     

    P.S. I moved your question to a separate thread. In the future, please do not reply to old threads with questions that are not related to the original topic. Thanks!