Last post Jun 28, 2018 06:56 AM by Yohann Lu
Jun 27, 2018 12:23 PM|Kati Ais|LINK
I use OLEDB to read excel file, I have an Excel file with macro (.xlsm) for that I used this connector:
string connexion_string = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + file + ";Extended Properties=\"Excel 12.0 Macro;HDR=YES;IMEX=1;\"";
OleDbConnection connexion = new OleDbConnection(connexion_string);
catch (Exception e)
Console.WriteLine("Erreur: " + e);
but I get this error:
Échec de IErrorInfo.GetDescription avec E_FAIL(0x80004005).
and return null
any solution please?
Jun 27, 2018 01:54 PM|PatriceSc|LINK
It seems OleDb can't even, retrieve an actual error message. The file does exists, is not password protected, is not blocked by an antivirus software ? I would perhaps try with a dead simple XLSX file to see what happens. If ok, I would add a macro and save
to XLSM to see once again what happens with this simple file.
I'm trying to understand if this is a problem on the web server side or if the problem could be caused by this particular XLSM file.
Edit: try maybe to drop the final ; in case the connection string parser would expect then Something following this final separator ???
Jun 28, 2018 06:56 AM|Yohann Lu|LINK
Hi Kati Ais,
Which section of the code causes this error? Please debug step by step.
You can refer the following thread's solution: putting  around the reserved word in the select statement.
Error: IErrorInfo.GetDescription failed with E_FAIL(0x80004005):
Please refer to PatriceSc's suggestion to share more details.
Read and Write Excel Documents Using OLEDB: