Microsoft Excel cannot access the file 'C:\trng\abc.xslx'. There are several possible reasons:
• The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook.
for this I have killed "EXCEL.EXE" file from task manager but still it gives above mentioned error.
Its working perfectly fine when i am using VS 2010 server but its giving error
"External table is not in the expected format"
when I am hosting it on IIS 7.5.
Are you sure that your issue happens when you deploy the file onto IIS7.5 and the problem happens?And everything goes well when using the file on your local machine?If yes,I guess there's something wrong your deployment of the file or something related to
that……
mannnn
Member
4 Points
11 Posts
"External table is not in the expected format"
Apr 16, 2012 10:23 AM|LINK
Hii..
I am retrieving data from excel using following connection string:
static string datasource = "C:\\Drive\\Training_Template.xlsx";
OleDbConnection DBConnection = new OleDbConnection(@"PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" + datasource + ";Extended Properties='Excel 12.0 Xml'");
Its working perfectly fine when i am using VS 2010 server but its giving error
"External table is not in the expected format"
when I am hosting it on IIS 7.5.
I am using excel 2010.
please suggest me some solution to deal with this error..
Thanks..
alejandro.la...
Member
2 Points
8 Posts
Re: "External table is not in the expected format"
Apr 16, 2012 03:30 PM|LINK
Hi, are you sure that u are uploading a '.xlsx' file and that it haven't password ? :-)
This is the connection that I'm using and it works:
mannnn
Member
4 Points
11 Posts
Re: "External table is not in the expected format"
Apr 17, 2012 09:15 AM|LINK
Hii alejandro.lagos
Thanks for reply:)
I am not getting the same error now. This time I used the below mentioned connection string
OleDbConnection DBConnection = new OleDbConnection(@"PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" + datasource + ";Extended Properties='Excel 12.0 Xml;HDR=YES;IMEX=1'");
But now I am getting a new error
Microsoft Excel cannot access the file 'C:\trng\abc.xslx'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
for this I have killed "EXCEL.EXE" file from task manager but still it gives above mentioned error.
I seriously dont know what to do:(
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: "External table is not in the expected format"
Apr 18, 2012 01:46 AM|LINK
Are you sure that your issue happens when you deploy the file onto IIS7.5 and the problem happens?And everything goes well when using the file on your local machine?If yes,I guess there's something wrong your deployment of the file or something related to that……
mannnn
Member
4 Points
11 Posts
Re: "External table is not in the expected format"
Apr 18, 2012 04:51 AM|LINK
Hii..
To ensure that there is no problem in hosting, I hosted another application in same way and it worked perfectly...
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: "External table is not in the expected format"
Apr 18, 2012 05:12 AM|LINK
Try to remove "Xml" and have a try:-)
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: "External table is not in the expected format"
Apr 18, 2012 05:12 AM|LINK
Try to remove "Xml" and have a try:-)
mannnn
Member
4 Points
11 Posts
Re: "External table is not in the expected format"
Apr 19, 2012 04:01 AM|LINK
Hi Decker Dong-MSFT
I have tried all these things...
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: "External table is not in the expected format"
Apr 19, 2012 04:33 AM|LINK
Still the same error?Or error is changed?
And is your excel file valid?
mannnn
Member
4 Points
11 Posts
Re: "External table is not in the expected format"
Apr 19, 2012 05:17 AM|LINK
yup same error..