Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to import data into datatble using importsheet
#1
Not Solved
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
Reply
#2
Not Solved
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
Reply
#3
Not Solved
Thanks Venkat for your clarification. It work's now.
Reply
#4
Not Solved
I have the same issue, I am using MSexcel 2007 starter on my windows 7 PC. Do you know the solution for it?
Reply
#5
Not Solved
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!
Reply
#6
Not Solved
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.
Reply
#7
Not Solved
Just use excel 2007 save it in the .xls format and import it into the datatable of qtp
Reply
#8
Not Solved
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/0...mport.html

Regards,
Ankesh
Reply
#9
Not Solved
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Datatable.importsheet error niks19 2 3,410 08-21-2015, 12:00 AM
Last Post: ADITI1992
  Datatable import error Prashanth 7 16,400 11-19-2014, 06:53 PM
Last Post: praveen.g3
  How to import .xlsx file type to QTP qtped 3 6,669 03-27-2014, 01:33 PM
Last Post: Ankur
  Import multiple values from excel into QTP Shaik Ahmed 2 3,517 03-09-2014, 09:17 PM
Last Post: Shaik Ahmed
  Import and read multiple tabs on a datasheet trance07 1 3,387 10-09-2013, 07:29 PM
Last Post: Parke

Forum Jump:


Users browsing this thread: 1 Guest(s)