Steve
unread,Aug 13, 2009, 2:57:02 PM8/13/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to QTP - HP Quick Test Professional - Automated Software Testing
I am trying to import several data sheets from one excel file into
QTP's datatable.
Here is what I have so far (it does work, it just looks aweful):
-------------------------------------------
''Load all of the datasheets required from excel into QTP's datatable.
DataTable.AddSheet("Tabs")
DataTable.AddSheet("Navs")
DataTable.AddSheet("Sub1")
DataTable.AddSheet("Sub2")
DataTable.AddSheet("Sub3")
DataTable.AddSheet("Sub4")
DataTable.AddSheet("Sub5")
DataTable.AddSheet("Sub6")
DataTable.AddSheet("Sub7")
DataTable.AddSheet("Sub8")
DataTable.AddSheet("Sub9")
DataTable.AddSheet("Sub11")
DataTable.AddSheet("Sub10")
DataTable.AddSheet("Sub12")
DataTable.AddSheet("Sub13")
DataTable.AddSheet("Sub14")
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Tabs", "Tabs"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Navs", "Navs"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub1", "Sub1"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub2", "Sub2"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub3", "Sub3"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub4", "Sub4"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub5", "Sub5"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub6", "Sub6"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub7", "Sub7"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub8", "Sub8"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub9", "Sub9"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub10", "Sub10"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub11", "Sub11"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub12", "Sub12"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub13", "Sub13"
DataTable.ImportSheet "\\Louapp02\CS_QA QTP Files\Portal\common.xls",
"Sub14", "Sub14"
----------------------------------------------
There has got to be a cleaner way to do this. To combine it and make
it simipler.
I didn't find anything online or in the QTP Help file to aid me in
this.
Any ideas??
Thanks,
Steve