How to use a variable in WinFormsObject() in VBScript?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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("frmPatternMetaData").WinFormsObject("grpPatternID").WinFormsObject("txtPatterName")
I am aiming to something like (not sure if concatenation if right):
Set Obj = Sys.Process("GemCat_Gui").WinFormsObject("frmPatternMetaData").WinFormsObject("grpPatternID").WinFormsObject(" & myparam & ")
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
