1
        string fileName = "e:\\investigation\\report.xlsx";
        string SHEETNAME_HERE = "Sheet1";
        string connectionString = String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=YES\";", fileName);
        OleDbConnection con = new OleDbConnection(connectionString);
        StringBuilder stbQuery = new StringBuilder();
        stbQuery.Append("SELECT * FROM [" + SHEETNAME_HERE + "]");
        OleDbDataAdapter adp = new OleDbDataAdapter(stbQuery.ToString(), con);

        DataSet dsXLS = new DataSet();
        adp.Fill(dsXLS);

I am using Windows 64-bit and Office 2010 (32-bit) is Could not find installable ISAM.

Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177
  • Is your compiler targeting x86? – LarsTech Apr 19 '13 at 16:56
  • Funny you asked. Im not sure. I think its Any CPU. but I'm trying to figure out how to change it for 32-bit. I saw a forum post suggesting to try 32-bit compiling – Cocoa Dev Apr 19 '13 at 16:58
  • You made a lot of changes from the code I originally gave you on [This Question](http://stackoverflow.com/questions/16107429/reading-an-excel-file-with-c-sharp-causes-oledbexception-to-be-thrown/16109165?noredirect=1#comment23005221_16109165) – user2140261 Apr 19 '13 at 17:05
  • Its the same code. Names of the variable changed. – Cocoa Dev Apr 19 '13 at 17:16
  • to start the Sheet name is missing the trailing `$` the connection is using a different provider, – user2140261 Apr 19 '13 at 17:29
  • same error. I found this article and the registry keys don't exist. http://support.microsoft.com/kb/209805 – Cocoa Dev Apr 19 '13 at 17:37
  • I changed it to the one that you provided and it gives a NEW message. "The Microsoft Access database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly. If 'Sheet1$' is not a local object, check your network connection or contact the server administrator. – Cocoa Dev Apr 19 '13 at 17:44
  • MAke sure you have security privileges to access the file – user2140261 Apr 19 '13 at 18:19
  • to access the Excel file?. I do because I can open it with Excel. I can read, write to the file too – Cocoa Dev Apr 19 '13 at 18:41
  • is E a shared drive/network drive? If so try to copy the excel file to the local drive and point the c# to the new locatin and see what happens. – user2140261 Apr 19 '13 at 18:55
  • E is a USB drive (HDD). – Cocoa Dev Apr 19 '13 at 19:09
  • Try to copy the file t the root of the C drive(or your local hard drive) and try to access it and see if it works the problem might have something to do with accessing it over USB, but I am stumped. But at least trying it from a local drive will help point us in the correct direction. – user2140261 Apr 19 '13 at 19:26
  • I think my [question][1] can help you... [1]: http://stackoverflow.com/questions/20949326/could-not-find-installable-isam-while-filling-data-in-dataset – Dhwani Jan 07 '14 at 06:31

1 Answers1

1

You need to verify the correct DLL is installed. IE Msexcl40.dll

see (ignore it says access 2k and follow the steps for resolving) http://support.microsoft.com/kb/209805

Sorceri
  • 7,870
  • 1
  • 29
  • 38