0

I used to using ADODB.Recordset to operate worksheet with "Microsoft ActiveX Data Objects 6.1 Library".

For example:

Function Sampe()

    Dim conn As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim sql As String
    
    sql = "SELECT * FROM [Sheet1$]"
    Set conn = CreateObject("ADODB.Connection")
    conn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThisWorkbook.FullName & ";Extended Properties=""Excel 12.0;HDR=YES"";"
    Set rs = conn.Execute(sql)
    
    While Not rs.EOF
    
        'process data
        
        rs.MoveNext
    Wend
    conn.Close
    
End Function

This code works fine in windows but would occur error "Can't find project or library" on macOS Excel 2019.

Looks like macOS didn't support ActiveX dll.

Is there any other way to use sql to operate workSheet data without ADODB?

EvaHHHH
  • 293
  • 3
  • 16
  • 1
    Check this question: https://stackoverflow.com/questions/9707256/is-there-a-way-to-get-adodb-to-work-with-excel-for-mac-2011 – MGP Oct 17 '22 at 08:40
  • @MGP I see, but seems like need purchase license for commercial, is there any free way? – EvaHHHH Oct 17 '22 at 09:14

0 Answers0