Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help - how can I determine if a column exists?
#1
Solved: 11 Years, 4 Months, 3 Weeks ago Sad 
Hi!

I have a kind of showstopper problem and desperately need help. I am writing on something like a little testframework that makes the datadrive easier.

In order to do that I import datasheets into tests, but then need to add parameters (=columns) with specified names to the sheet.

The problem is, if I just used....

...sheet.addParameter("bla")...

if a column "bla" already exists, QTP will create another column "bla1". I DONT WANT THAT!

Therfore the simple basic common sense logic is to use ..
..sheet.getParameter("bla")..
...and check if it returns 'nothing', but unfortunately this method throws an error if the column does not exist instead of returning null or whatever.
(I am sorry, but whoever wrote this method must be a nutter).

Surely there is work arounds like trying to use "on error resume next" or using my own hashtable, but there must be a proper way!

So, please, does anyone here know how to check if a column in a sheet exists? Maybe its really simple and I just did not get it..PLEASE!!!

Thanks in advance!!!!
CC
Reply


Messages In This Thread
Please help - how can I determine if a column exists? - by ConstantChange - 02-28-2008, 07:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  to count the number of used rows in a particular column sujaravi123 3 11,220 06-12-2013, 03:17 PM
Last Post: sujaravi123
  How to recognize table row and column siwani 4 5,140 04-05-2012, 05:06 PM
Last Post: verma.vik6
  text exists or not sujaravi123 3 5,297 11-09-2011, 11:57 PM
Last Post: as_srini
  Reading xls by column name anbarasu 2 3,287 04-05-2010, 12:26 PM
Last Post: Saket
  how to check if selection in menu exists.. Anil Kumar 1 3,580 10-15-2009, 08:45 PM
Last Post: jsknight1969

Forum Jump:


Users browsing this thread: 1 Guest(s)