Click here to Skip to main content
16,017,922 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Connection String for Microsoft Excel:
C#
OLEDBconnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\User\Documents\file.xlsm;Extended Properties='Excel 12.0 Macro;HDR=YES';"


Error code:
"'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine."

How do you register 'Microsoft.ACE.OLEDB.12.0' on my local machine?


What I have tried:

Added References: Excel 14.0, DOA, OLE, etc.

1)
C#
OLEDBconnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\User\Documents\file.xlsm;Extended Properties='Excel 8.0 Macro;HDR=YES';"


2)
C#
OLEDBconnectionString="Provider=Microsoft.JET.OLEDB.4.0;Data Source=C:\Users\User\Documents\file.xlsm;Extended Properties='Excel 4.0 Macro;HDR=YES';"
Posted
Updated 30-Apr-16 9:43am
v3
Comments
PIEBALDconsult 30-Apr-16 16:09pm    
Install Office.
Or install the "Microsoft Access Database Engine 2010 Redistributable"
https://www.microsoft.com/en-us/download/details.aspx?id=13255
Member 11242200 30-Apr-16 16:32pm    
Is there a certain way to configure "Microsoft Access Database Engine 2010 Redistributable" to be able to use "Microsoft.ACE.OLEDB.12.0"?

1 solution

A proper connection string is:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsm;
Extended Properties="Excel 12.0 Macro;HDR=YES";


See: Excel connection strings - ConnectionStrings.com[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900