VBA: Could not find Installable ISAM (Works in some computers and others don't)

56 views Asked by At

everyone!

My company is creating an excel file that connects to SharePoint for a client. And it works fine in my machine and in the VM of the client's company. But when we try to run the code on the laptop of the client, We get this error. (Could not find installable ISAM)

Sub executeSQLList(sql As String, list As String)
    Dim conn As Object
    Dim connString As String

    connString = "Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=0;RetrieveIds=Yes;DATABASE=https://mysite;LIST=" & list & ";"

    Set conn = CreateObject("ADODB.Connection")
    conn.Open connString
    conn.Execute sql
    conn.Close

    Set conn = Nothing
    Application.ScreenUpdating = False
End Sub

I checked the permissions on Sharepoint and it seems ok. I also checked the code bellow and it works fine.

Function ConnectToExcelSheet(sql_query As String) As Object
    Dim conn As New ADODB.CONNECTION
    Dim rs As New ADODB.Recordset
    Dim connString As String
    
    'https://stackoverflow.com/questions/21820663/recordset-count-number-in-vba
    rs.CursorLocation = adUseServer
    
    connString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
                 "Data Source=" & ThisWorkbook.FullName & ";" & _
                 "Extended Properties='Excel 12.0 Macro;HDR=YES'"
    
    conn.Open connString
    rs.Open sql_query, conn  
    Set ConnectToExcelSheet = rs
    Application.ScreenUpdating = False
End Function

How can i solve that? My other guess is in the version difference between my excel and the client's excel.

Thanks!

0

There are 0 answers