Micro Focus QTP (UFT) Forums

Full Version: dtGlobalSheet Columns
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to search the Gobal sheet and verify that a Column exists?

and if it does not I would need to add a column


thanks
Yes. Use
Code:
GetParameterCount
method to get the total no of columns. Loop through all the columns to check for the existence. If it is not found add a parameter (column) using
Code:
AddParameter
method.
[quote=Jackomcnabb]
Thanks a lot.

I had a datasheet with two Columns (Col1 & Col2) and I need to verify that if there was not a Col3 to add to to my script so when it is called later the call would not fail

Code:
a=DataTable.GetSheet(dtGlobalSheet).getparametercount
For i=1 to a
b=DataTable.GetSheet(dtGlobalSheet).GetParameter(i).Name
Next
If b <> Col3  Then
DataTable.GetSheet(dtGlobalSheet).AddParameter "Col3","Test this "
End If
Test1=DataTable("Col3", dtGlobalSheet)

msgbox(Test1)