02-28-2008, 07:22 PM
(This post was last modified: 02-28-2008, 07:34 PM by ConstantChange.)
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
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