2

I have built a small WPF app that will read in XLS or XLSX files and display the contents in a datagrid. I have the XLS side of things working by using the Microsoft.Jet.OLEDB.4.0 provider. I am struggling with the XLSX side of things. I am running Windows 7 (64-bit) and have Office 2010 (64-bit) installed on my machine. I see the version 14 and 12 versions of the OLEDB in my ODBC connections. When I run my connection string it returns an error. I have read through many of the posts without any successful answers, many pointing to the version the app is running which is x86. I have tried both 14.0 and 12.0 getting the same error with respective version numbers.

Connection String:
Provider=Microsoft.ACE.OLEDB.14.0;Data Source=C:\Users\xxxxx\Desktop\test.xlsx;Extended Properties=\"Excel 14.0;HDR=Yes;IMEX=1\"

Code:

using (OleDbConnection connection = new OleDbConnection(GetConnectionString()))
{
    connection.Open();
}

Error:
The 'Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine.

Johnny Willemsen
  • 2,942
  • 1
  • 14
  • 16
Kris
  • 81
  • 2
  • 3
  • 14
  • Does this answer your question? ['Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine](https://stackoverflow.com/questions/6649363/microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine) – Zev Spitz Mar 03 '21 at 14:03

2 Answers2

0

From what I've ready trying to deal with this, you can end up with different drivers registered for 32-bit and 64-bit on an x64 machine.

The clearest example I've seen of demonstrating this is searching for ODBC administration from your start menu, and comparing the 32-bit and 64-bit lists when yo ugo to add a new DSN

Roger Willcocks
  • 1,649
  • 13
  • 27
0

I was having the same issue. I am using Office 2010 products.

I had to download the Office 2007 Access Database Engine in order to get my app to work.

Download the following:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en

JRP
  • 181
  • 2
  • 7