Connecting to Excel File using OLEDB


  • Hi Guys, I'm trying to make a program that edits an excel file. But it keeps telling me "The 'Microsoft.ACE.OLEDB.16.0' provider is not registered on the local machine."

    Here is what my connection string code looks like:

    OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.16.0;Data Source=" + textselect.Text + @";Extended Properties=Excel 16.0");

    'txtselect' is just a textbox on my form.

    I have excel 2016, so that is why i put "16.0" in the connection string. If that is no how it works, how do I check what is the correct provider number?

    I really appreciate the help guys. I've been stuck on this for a few days now. I just want to edit and update an excel file on my desktop with my program. If you guys have any  better ways or tutorials you think I should watch I'm all ears for that as well. But almost every tutorial I've seen uses the above code to connect to the file so I'm just lost now.

    Thank you-

    Wednesday, April 5, 2017 6:20 PM


All replies