I can't open an Excel spread sheet with .NET on an x64 server using the following connection string
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + filePath + "; Extended Properties=Excel 8.0;"
I get The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.
I installed the 2007 Office System Driver: Data Connectivity Components and tried with Microsoft.ACE.OLEDB.12.0 and this connection string
"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + filePath + "; Extended Properties=Excel 8.0;"
and got "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine."
I searched Google with the only response being it's a 64 bit problem, anyone have an Idea how to fix this?
You can use the Open XML SDK to open an Excel 2007 file and read or change the contents.
http://www.microsoft.com/downloads/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&DisplayLang=en
This does not use the Excel program but opens it as an xml document. Thus you get around the 64bit problem.
It may however require major changes to your program.
You can only do this from the 32 bit version of the framework. if its an ASP.net app you can change the server to run this under the 32 bit framework. If it's a native app you'd have to recompile (although that's probably best asked on stackoverflow)
you cant, the drivers arent there. Only workaround I have found is if you can, save it as a csv and read it that way.
All Office drivers are 32-bit only, so you can't use Office files from x64 applications; the problem is most commonly experienced when ASP.NET applications on x64 systems try to open Acess databases.
You need to force you application to run in x86 mode; is it a Windows application or a ASP.NET one? In ASP.NET, you can do it as stated here.
I haven't tried it, but apparently the /passive installation switch might be a workaround with 64bit Ace.