B
Bertrand Bram
Hi !
I currently have a problem with OWC library (v10.0.4505.0) in C# : my
program is trying to read an Excel file it generated before. The problem
is, the Excel file is written in XML format and the program doesn't seem
to be able to handle this ("External table is not in the expected format").
Writing section :
---------------
SpreadsheetClass xlsheet = new SpreadsheetClass();
xlsheet.ActiveSheet.Cells[1,1] = "Hello";
xlsheet.Export(xlFileName,
SheetExportActionEnum.ssExportActionNone,
SheetExportFormat.ssExportHTML);
Response.ContentType = "application/x-msexcel";
Response.AppendHeader("content-disposition",
"attachment; filename=\"" + xlFileName + "\"");
Response.WriteFile(fileName);
Reading section :
---------------
string sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + xlFileName + ";" +
"Extended Properties=\"Excel 8.0;HDR=Yes\"";
OleDbConnection objConn = new OleDbConnection(sConnectionString);
objConn.Open(); // "External table is not in the expected format" when
trying
Can anyone solve this problem ? Thanks in advance !
I currently have a problem with OWC library (v10.0.4505.0) in C# : my
program is trying to read an Excel file it generated before. The problem
is, the Excel file is written in XML format and the program doesn't seem
to be able to handle this ("External table is not in the expected format").
Writing section :
---------------
SpreadsheetClass xlsheet = new SpreadsheetClass();
xlsheet.ActiveSheet.Cells[1,1] = "Hello";
xlsheet.Export(xlFileName,
SheetExportActionEnum.ssExportActionNone,
SheetExportFormat.ssExportHTML);
Response.ContentType = "application/x-msexcel";
Response.AppendHeader("content-disposition",
"attachment; filename=\"" + xlFileName + "\"");
Response.WriteFile(fileName);
Reading section :
---------------
string sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + xlFileName + ";" +
"Extended Properties=\"Excel 8.0;HDR=Yes\"";
OleDbConnection objConn = new OleDbConnection(sConnectionString);
objConn.Open(); // "External table is not in the expected format" when
trying
Can anyone solve this problem ? Thanks in advance !