Micro Focus QTP (UFT) Forums
Datatable add and datatable import sheet - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Datatable add and datatable import sheet (/Thread-Datatable-add-and-datatable-import-sheet)



Datatable add and datatable import sheet - wheelercha - 12-31-2009

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


RE: Datatable add and datatable import sheet - wheelercha - 01-04-2010

I actually got this to work!! Thanks all.


RE: Datatable add and datatable import sheet - tarunsuneja - 06-14-2012

Hi,

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

Thanks & Regards,
Tarun Suneja


RE: Datatable add and datatable import sheet - ssvali - 06-14-2012

Hi

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

Change the excel to .xls and try to import.


RE: Datatable add and datatable import sheet - Arul - 06-14-2012

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