I just upgraded from Excel 2007 to 2010. The code below gives me this error on the line .Open Provtxt
UPDATE ALERT: ACCESS WAS NOT COMPLETELY INSTALLED. WHEN I TRIED TO OPEN IT, IT INSTALLED AND NOW I AM GOOD TO GO. SORRY...
Run-time error '3706':
Provider cannot be found. It may not be properly installed.
Suggestions?
UPDATE ALERT: ACCESS WAS NOT COMPLETELY INSTALLED. WHEN I TRIED TO OPEN IT, IT INSTALLED AND NOW I AM GOOD TO GO. SORRY...
Run-time error '3706':
Provider cannot be found. It may not be properly installed.
Suggestions?
Code:
Sub DelYYYYPP(TheTable, YYYYPP, HowMany)
Dim ThePath, TheFile As String
Dim ProvTxt As String
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim MyConn As String
Dim DelTxt As String
If LCase(HowMany) = "all" Then
Let DelTxt = "Delete FROM " & TheTable & " WHERE YYYYPP = " & Chr(34) & YYYYPP & Chr(34)
Else
Let DelTxt = "Delete From " & TheTable & " WHERE `Project ID`='" & HowMany & "' AND YYYYPP='" & YYYYPP & "'"
End If
Windows("projects.xlsm").Activate
Sheets("intParam").Select
Range("thePath").Select
Let ThePath = ActiveCell.Value
Range("theFile").Select
Let TheFile = ActiveCell.Value
Let ProvTxt = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThePath & Application.PathSeparator & TheFile '& ";Extended Properties=Excel 12.0 Xml;HDR=YES;"
Set cnn = New ADODB.Connection
With cnn
.Open ProvTxt
.Execute DelTxt
End With
cnn.Close
End Sub
Last edited: