0

I am exporting a file in xlsx format after saving the file i am importing it back, but while importing it back I am getting External table is not in the expected format exception. However when i am opening the imported file and just save it again it work like a charm and I am able to import it back

For Exporting

content type - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
context.Response.WriteFile(filePath);

For Importing

Excel connection string - "Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=" + (char)34 + "{1};HDR=Yes;IMEX=1" + (char)34 + ";";
RobIII
  • 8,488
  • 2
  • 43
  • 93
  • could you please check the following solution? [https://stackoverflow.com/questions/1139390/excel-external-table-is-not-in-the-expected-format](https://stackoverflow.com/questions/1139390/excel-external-table-is-not-in-the-expected-format) Best regards. – Kevin H. Jun 14 '17 at 06:47
  • @KevinH. H , My solution and one you suggested are similar. My code is working if I explicitly save the exported excel before importing but when I import the excel without saving it throws exception. – Kshitiz Jaiswal Jun 15 '17 at 04:54

0 Answers0