Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Datatable add and datatable import sheet
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
All,

I am trying to do two things. Simply import data into a datatable from Excel 2007. So I used this:

Code:
Datatable.AddSheet "CategoryReportData"
DataTable.ImportSheet "C:\CategoryTotalReport.xlsx",1,"CategoryReportData"

Couple of questions:
1) On - Datatable.AddSheet "CategoryReportData" - should I see this datatable in QTP? Currently, QTP executes the statement with no errors but I don't see that it's added.

2) When QTP gets to the next statement it fails with :

A general error occurred while importing sheet CategoryReportData from file C:\CategoryTotalReport.xlsx to sheet CategoryReportData.


I can't figure this out. Any idea?

Thanks - Charles
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
I actually got this to work!! Thanks all.
Reply
#3
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi,

Can you please share the resolution here.
I'm also facing the same problem.

Thanks & Regards,
Tarun Suneja
Reply
#4
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi

QTP does not support .xlsx file to import into datatable.

Change the excel to .xls and try to import.
Reply
#5
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi,

In qtp, which version you are using.

1) On - Datatable.AddSheet "CategoryReportData" - should I see this datatable in QTP?
You can see only in the runtime data table.
after completing the execution, two sheets are availanble(Action,Global)

Thanks,
Arul
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading Global Sheet's DataTable Value Bhuvana 0 1,463 01-05-2020, 10:03 PM
Last Post: Bhuvana
  Identify and Count the columns in the datatable Bhuvana 0 820 12-20-2019, 11:15 PM
Last Post: Bhuvana
  Error as Global Not defined while trying to retrieve value from Datatable siddharth1609 0 842 09-11-2019, 02:52 PM
Last Post: siddharth1609
  How to append date to xls file using qtp datatable methods? yona34 1 1,458 05-04-2018, 08:56 PM
Last Post: Ankur
  UFT Datatable iterations Studymode 2 3,462 12-12-2017, 11:10 PM
Last Post: Studymode

Forum Jump:


Users browsing this thread: 1 Guest(s)