Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Column Names in DataTable within QTP
#3
Solved: 10 Years, 10 Months, 1 Week ago
I had an issue where I was missing, as I was running the same code for a number scripts and I built columns on the fly if they where missing, this maybe or not helpful:

Code:
ColNums=DataTable.GetSheet(dtGlobalSheet).getparametercount
For i=1 to ColNums
ColName=DataTable.GetSheet(dtGlobalSheet).GetParameter(i).Name
Next


If ColName <> Col3  Then
DataTable.GetSheet(dtGlobalSheet).AddParameter "Col3","Test this Col 3"
End If
If  ColName <> Col4  Then
DataTable.GetSheet(dtGlobalSheet).AddParameter "Col4","Test this Col 4"
End If

Test1=DataTable("Col3", dtGlobalSheet)
Test2=DataTable("Col4", dtGlobalSheet)

msgbox(Test1)
msgbox(Test2)
Reply


Messages In This Thread
RE: Column Names in DataTable within QTP - by Jackomcnabb - 02-26-2010, 11:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT issues with Outsystems dynamically generated Id/names jherron 2 1,150 03-02-2020, 09:33 PM
Last Post: Swishy70
  [UFT] Get column name from SfwObject felino 0 2,919 12-02-2015, 04:07 PM
Last Post: felino
  AddParameter method does not add in first column of datatable alpha1 4 5,355 07-14-2015, 12:44 AM
Last Post: supputuri
  Comparing two excel Sheets whose columns names vary Divya Roopa 2 8,338 03-26-2014, 07:20 PM
Last Post: Parke
  Unable to right click column header sudhirzpatil 4 6,116 07-18-2013, 09:42 PM
Last Post: sudhirzpatil

Forum Jump:


Users browsing this thread: 2 Guest(s)