Importing Excel into UFT always goes to GlobalSheet
Question ID: 108517
1
0

Using the below code I am trying to import an Excel spreadsheet into UFT datatable. My Excel spreadsheet only has one worksheet called "TestData". Only thing is, instead of importing into the DataTable sheet called "TestData", it always goes into the GlobalSheet instead of my TestData sheet. How can I fix this?

Datatable.Importsheet (TestDataFile),"TestData", 1

Marked as spam
Posted by (Questions: 387, Answers: 66)
Asked on July 24, 2018 8:34 pm
195 views
Answers (1)
1
Private answer

DataTable and Excel sheet indexes begin with 1, so if you use 1 as the index of the DataTable sheet, as your code shows, then it will always import into the GlobalSheet. The GlobalSheet is always present in a UFT GUI test and will always be index of 1. To change the sheet that the imported data goes into, either use the sheet name or a different index.

You can find this and other related information in the [UFT Help Center][1].

[1]: https://admhelp.microfocus.com/uft/en/14.03/UFT_Help/Subsystems/FunctionReference/Subsystems/OMRHelp/OMRHelp.htm#cshid=OV_Supp_Util/Parameterization_DataTable.htm#ImportSheet

Marked as spam
Posted by (Questions: 17, Answers: 807)
Answered on July 24, 2018 8:35 pm
0
Ok, I guess I didn't take the indexing into account. Thanks!
( at July 24, 2018 8:36 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top