I have write a macro in Excel 2016 on a windows pc via oledb connection. But it doesn't work in my Mac. How can I run this? Normally, in windows, you choose tools > references and check oledb connection but there isn't a tools option in Excel Mac. I don't know code is important here but I'll share it anyway.
Dim sorgu1 As String
Dim con As Object, rs As Object
Set con = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")
con.Open "provider=microsoft.ace.oledb.12.0;data source=" & _
ThisWorkbook.FullName & ";extended properties=""Excel 12.0;hdr=yes"""
makine = Sheets("Dashboard").Cells(2, 11).Value
sorgu1 = "select [Resource Id], [Order No], Sum(([Bitim Zamani]-[Basl Zamani])*1440)" 'as Plansiz, Sum(([Bitim Zamani]-[Basl Zamani])*1440)as Planli, Sum([Qty]) as Uretim"
sorgu1 = sorgu1 + " from [Data$] where [Resource Id] = " + "'" + makine + "'"
sorgu1 = sorgu1 + "GROUP BY [Resource Id], [Order No], [Duru Kodu]"
Set rs = con.Execute(sorgu1)
Sheets("Dashboard").Range("B65536").End(3).Offset(1, 0).CopyFromRecordset rs
Set rs = Nothing