Micro Focus QTP (UFT) Forums
Not able to import data into datatble using importsheet - 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: Not able to import data into datatble using importsheet (/Thread-Not-able-to-import-data-into-datatble-using-importsheet)



Not able to import data into datatble using importsheet - maddy9227 - 08-18-2010

I am not able to import the data from external .xlsx file using importsheer method....below is the code 'm using

Code:
Datatable.addsheet(mydata)
datatable.importsheet "C:\myfile.xlsx",mydata,mydata
I made sure that the myfile has the first sheet named as mydata.
But when running the code, the data is not getting imported.
Can anyone help me with this


RE: Not able to import data into datatble using importsheet - venkatbatchu - 08-18-2010

Hi Maddy,

Please check whether your excel file is save in 97-2003 format or not if you are using MS-2007 and saved with 2007 format then it will not able to import the data from excel to datatable.

Please let me know for fourther clarification

Regards,
Venkat.Batchu


RE: Not able to import data into datatble using importsheet - maddy9227 - 08-19-2010

Thanks Venkat for your clarification. It work's now.


RE: Not able to import data into datatble using importsheet - newqtp - 10-30-2012

I have the same issue, I am using MSexcel 2007 starter on my windows 7 PC. Do you know the solution for it?


RE: Not able to import data into datatble using importsheet - newqtp - 10-30-2012

I have found the issue, I have excel 2010 started which QTP doesnot support. I have to find a way or excel 2010 convert 2003. I used old 2003 excel and reusing for my project. Hope this help!


RE: Not able to import data into datatble using importsheet - vandhavarapu - 05-08-2013

Hi Venkat,
I have Excel2010 & saved the file in Microsoft Excel 97-2003 Worksheet format only.
but still facing the issue as :

1) If I am not placing any extension to the file & simply using the path & file name then QTP is throwing the below error,

A general error occurred while importing sheet Test1 from file C:\Documents and Settings\venkatesh.a\My Documents\Downloads\TestSheet to sheet Sheet1.

2) If I am placing the extension as .xls, then QTP throwing the below error,

A general error occurred while importing sheet Test1 from file C:\Documents and Settings\venkatesh.a\My Documents\Downloads\TestSheet.xls to sheet Sheet1.

3) If I am placing the extension as .xlsx, then QTP throwing the below error,

A general error occurred while importing sheet Test1 from file C:\Documents and Settings\venkatesh.a\My Documents\Downloads\TestSheet.xlsx to sheet Sheet1.

I am facing the same issue as mentioned above in all cases.
can you please help me out in this.


RE: Not able to import data into datatble using importsheet - vinod123 - 05-14-2013

Just use excel 2007 save it in the .xls format and import it into the datatable of qtp


RE: Not able to import data into datatble using importsheet - Ankesh - 05-15-2013

This error is very common now... Sometimes, when you import a file, the file gets locked by QTP somehow and it does not allow to import... You cant even delete the file as it will say the file is being used by another program.

You can chk the below link.. this may help.
http://automatingsap.blogspot.com/2012/07/general-error-when-exportimport.html

Regards,
Ankesh


RE: Not able to import data into datatble using importsheet - vinod123 - 05-15-2013

Save the file in .xls format. Right click on Datatable. Select Sheet and Select import and from that import from file it should import the excel sheet which you are facing the problem. After this if you face the problem again just close the qtp delete the file and start qtp and resume the process with new sheet