Click here to Skip to main content
13,093,184 members (78,756 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello friends,

While reading the .xlsx file I'm getting the The 'Microsoft.ACE.Oledb.12.0' provider is not registered on the local machine. exception.

Though I have installed AccessDatabaseEngine_x64. Download from
I'm trying to read and write both .xls and .xlsx files.

I tried to use gacutil.exe to put it dll to my local but couldn't succeed.

My conncetion strings are
if (extn.ToUpper() == ".XLS")
                excelConn = @"Provider=Microsoft.Jet.Oledb.4.0; Data Source=" + path + "; Extended Properties=Excel 8.0;";
            if (extn.ToUpper() == ".XLSX")
                excelConn = @"Provider=Microsoft.ACE.Oledb.12.0; Data Source=" + path + "; Extended Properties=Excel 12.0;";

Please put some light on this context and guide me.
Thanks :)
Posted 30-Oct-12 19:23pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can try this OLEDB Provider is not registered on the local machine[^]


try adding the Reference of 'Microsoft.ACE.Oledb.12.0.dll' to your project.
Manish Kumar Namdev 31-Oct-12 2:11am
Hello Bitla Phanindra Is there any way to work with both .xls and .xlsx file operation with c#. I'm using express edition 2010
Saroj Singh 28-Apr-14 7:23am
Please anyone answer this....
Bitla Phanindra 23-Jun-14 11:35am
Check my comment below..
All Time Programming 1-Feb-14 3:15am
I tried forcing to compile using x86 platform only, but that didn't worked for me. Finally I tried installing the Driver from and that made my app running back to normal.
Bitla Phanindra 23-Jun-14 11:34am
You can try it this way..
if (FilePath.Trim().EndsWith(".xlsx"))
strConn = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0 Xml;HDR=YES;IMEX=1\";", FilePath);
else if (FilePath.Trim().EndsWith(".xls"))
strConn = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";", FilePath);

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100