Click here to Skip to main content
13,054,779 members (70,778 online)
Click here to Skip to main content
Add your own
alternative version


20 bookmarked
Posted 17 May 2009

Microsoft OLEDB Adapter for Microsoft Excel 2007

, 17 May 2009
Rate this:
Please Sign up or sign in to vote.
Microsoft OLEDB adapter for Microsoft Excel 2007.


This article is for developers who want to play with different Office files (*.csv, *.xlsx, *.xls, *.doc) without Office being installed on the machine, by using Microsoft OLEDB Jet drivers. I am writing this article to just help you out with Microsoft Jet OLEDB problems with Microsoft Office 2007.


Recently, I was working on my application for dynamic data to get data from Excel sheets. I was using Microsoft Jet OLEDB drivers for Excel 8.0 ISAM. It was working fine with *.xls extensions. But, I came across the problem of Microsoft Excel 2007 *.xlsx not working with Microsoft Jet OLEDB for Excel 8.0. One of the reason might be ISAM missing for Microsoft Excel 2007.

Using the code

I will not be explaining the whole phenomenon of getting Excel sheets from an Excel file and getting data from these sheets. You can find an article on working with Microsoft Jet OLEDB with Excel from CodeProject. However, I will guide you through the problem of connecting Excel 2007 with Microsoft Jet OLEDB.

What you have to do is change the connection string as follows. Remember to test this. You should have Microsoft Office 2007 (or Microsoft.Ace.Oledb components installed that you can find at: installed.

private string mExcelCon = @"Provider=Microsoft.ACE.OLEDB.12.0;";

private string mConnectionString; 
mConnectionString = mExcelCon + "Data Source=" + fileName + 
                    ";Extended Properties=" + Convert.ToChar(34).ToString() + 
                    "Excel 12.0;HDR=Yes" + Convert.ToChar(34).ToString();

Microsoft.Ace.Oledb 12.0 supports all Microsoft Excel versions up till 2007.


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


About the Author

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
BillW332-Sep-14 2:48
professionalBillW332-Sep-14 2:48 
GeneralMy vote of 1 Pin
Syed Javed9-Jan-13 3:01
memberSyed Javed9-Jan-13 3:01 
GeneralMy vote of 1 Pin
Aamer Alduais28-Apr-12 22:26
memberAamer Alduais28-Apr-12 22:26 
GeneralMy vote of 2 Pin
eOrdinary22-Jul-10 22:25
membereOrdinary22-Jul-10 22:25 
GeneralMy vote of 1 Pin
ITMaiO21-May-09 4:56
memberITMaiO21-May-09 4:56 
QuestionDoes it is not really obvious? Pin
cybertone17-May-09 20:40
membercybertone17-May-09 20:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 May 2009
Article Copyright 2009 by Abdul_Qayyum
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid