Text File Query - Provider Error

erock24

Well-known Member
Joined
Oct 26, 2006
Messages
1,163
I just changed to windows 7 and excel 2010. Now my excel macro code errors out saying provider not found, may not be properly installed. This is the function where the error occurs, do anyone know how to update the code to work with my new version of windows and excel.

Code:
Private Function GetCNN(ByVal csvPath As String) As ADODB.Connection
    Set GetCNN = New ADODB.Connection
    With GetCNN
        .CommandTimeout = 0
        .ConnectionTimeout = 0
        .Provider = "Microsoft.Jet.OLEDB.4.0"
        .ConnectionString = "Data Source = " & csvPath & ";" & _
                            "Extended Properties = ""text;HDR=Yes;FMT=Delimited(,)"""
        .Open
    End With
End Function
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try:-
Code:
.Provider="Microsoft.Ace.OLEDB.14.0"
 
Upvote 0
i get the same error message, "Provider cannot be found, it may not be properly installed. "
Error 3706.... Do i need to install something??
 
Upvote 0
Thanks for the link, I actually found what I needed from reading some fine print attached to a microsoft link within the thread. All i needed to do was change what you originally suggested to:

Rich (BB code):
.Provider="Microsoft.Ace.OLEDB.12.0"

thanks,
 
Upvote 0
D'oh! I thought .12 for Excel 2007, .14 for Excel 2010.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,488
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top