Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dtGlobalSheet Columns
#1
Not Solved
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
Reply
#2
Not Solved
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.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
[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)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Comparing two unsorted excel columns ProTester 2 2,490 09-13-2018, 02:11 PM
Last Post: ProTester
  How to Delete Rows with duplicate values in 1 columns in excel thru QTP. arpan 0 2,594 02-09-2015, 08:47 PM
Last Post: arpan
  How to get center data value in a odd number of rows and columns web table ... sai rajesh 0 2,608 11-13-2013, 10:24 PM
Last Post: sai rajesh
  Filter multiple columns in excel kamalteja 0 3,576 07-08-2013, 02:28 AM
Last Post: kamalteja
  Not able to read all the columns in a DevEx WPF grid srisrinath2006 1 2,847 05-10-2013, 03:45 AM
Last Post: sria123

Forum Jump:


Users browsing this thread: 1 Guest(s)