I followed a few examples on the internet. Installed AccesDataBaseEngine.
But still I get this error message:
System.Data.OleDb.OleDbException: 'External table is not in the expected format.'
I tried some things that people suggestes, but nothing works.
This is the code:
string path = @"C:\...\...\Desktop\MyFile.xlsx";
string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;";
var dataAdapter = new OleDbDataAdapter("SELECT * FROM [HHH$]", connectionString);
var dataTable = new DataTable();
dataAdapter.Fill(dataTable);
What did I forgot?