Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unable to import excel data in to data table
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi All,

I'm also struggling to import an excel file to Datatable. I have an excel by name Sample.xls and my script is as below
Code:
Dim qt
Set qt = createobject("QuickTest.Application")
qt.Launch
qt.Visible=True
DataTable.ImportSheet "C:/Users/Desktop/Sample.xls",1,"Global"

I wrote this in expert view of QTP and ran it. When I run it, I'm seeing the Global sheet of DataTable getting populated (I see the values copied to cell quickly), but at the end of the run, there are no values in the DataTable. I also see 5 iterations of the execution, in the HP results view, where as I ran it only once.

Can somebody throw some light on this ?
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
u can find the data only during run time...
once execution is done...u can find the data in run time data table of results file
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi RGummadidala,

When you import excel in datatable, it is displayed in the global sheet but it is actually imported in the run time datatable. Check the run time datatable in the results, you will see all the values. But as soon as the run is completed and the script stops execution, the values will disappear from qtp datatable.

There might be 5 rows of data you are improting thats why your script performed 5 iterations eventhough you ran the script only once. Check the Test Settings -- Run tab. Option selected might be "Run on all rows".
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,
Thanks for your advice,my problem got sloved.


Regards,
Rgummadidala.
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,
I am having similar kind of code but values are not loading to runtime table and script is failing.
Note:I don't have MS office installed in my server where QTP installed.
Please help on this.

Code:
Code:
globalpath = DataTable.Value("Global_Path","MainAction")
    DataTable.ImportSheet globalpath, "Global","Global"

Thanks,
Sree
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,337 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Set data parameters Mik2s 1 1,481 03-07-2019, 10:18 PM
Last Post: supputuri
  Excelsheet data entry Anshu 0 1,618 07-11-2017, 07:41 PM
Last Post: Anshu
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,309 07-10-2017, 04:20 PM
Last Post: rajeevk7
  dtLocalSheet empty even though excel file contains data cantorre 2 2,428 05-10-2017, 12:47 PM
Last Post: vidhi

Forum Jump:


Users browsing this thread: 1 Guest(s)