Diagnosing an OLEDB exception when Quering Excel 2010
Perhaps you uninstalled the Access Database Engine (ACE) components? They are still available for download from MSDN as 2007 Office System Driver: Data Connectivity Components.
asp.net 4.0 to excel 2010 in command line app not working - drivers not found even after driver install
I did several things so I'm not sure if all the steps are important.
I registered my dlls according to this kb article http://support.microsoft.com/kb/209805. Before registering them, I verified there were no entries in the registry. This got me to the ISAM not found exception.
Then, thanks to Dave R, I changed my connection string. The final connection string that worked was (notice the escaped quotes on the Extended Properties)
string connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;data source={0};Extended Properties=\"Excel 12.0 Xml;IMEX=1\"", filename);
I didn't realize the file extension (.xlsx) was relavant to the connection string but after reading the connection string information here (http://www.connectionstrings.com/excel-2007), I fixed it.
Parsing excel files fails
Save yourself time and headache and use EPPLUS instead. EPPLUS can be installed via Nuget and you don't have to deal with installing the Office Data access on other machine where your code runs.
Related Topics
How to Compare Software Versions Using SQL Server
Subtract Hours from the Now() Function
Pivot Dynamically, Returned Results from Join of Two Tables
Fetch Records That Are Non Zero After the Decimal Point in Postgresql
How to Drop a Foreign Key Constraint Only If It Exists in SQL Server
In SQL Server, When Should You Use Go and When Should You Use Semi-Colon ;
SQL Recursive Query That Gets All Ancestors of an Item
How to Get the Difference Between Two Dates Rounded to Hours
How Does Select Top Works When No Order by Is Specified
Pivot Without Aggregate Function in Mssql 2008 R2
Extract Numbers from a Text in SQL Server
Sql: Using Dateadd with Bigints
How to Store Decimal Values in SQL Server