Is there a way to get ADODB to work with Excel for Mac 2011?

ADODB is NOT supported in Mac Excel 2011, but ODBC works in conjunction with a 3rd party driver.

I got my ODBC drivers from ActualTech. Download and install their program and you'll have the necessary drivers for connecting to SQL servers and databases (Free to try, $35 to purchase).

The following code creates a connection to a mySQL database, and returns information from the database into Cell A1:

Dim connstring as String
Dim sqlstring as String

connstring = "ODBC;DRIVER={Actual Open Source Databases};" _
& "SERVER=<server_location>;DATABASE=<database>;" _
& "UID=<userID>;PWD=<password>;Port=3306"
sqlstring = "select * from <database_table>"

With ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=Range("A1"), Sql:=sqlstring)
  .BackgroundQuery = False
  .Refresh
End With

Are there add-ins available? Even from a third-party?

Hope these download links helps?

ODBC drivers that are compatible with Excel for Mac


Quoted from the MSKB in case the link dies

ODBC drivers that are compatible with Excel for Mac

If you want to import data into Excel for Mac from a database, you need an Open Database Connectivity (ODBC) driver installed on your Mac. The driver you get depends on which version of Excel for Mac you have.

Excel for Mac 2011

This version of Excel does not provide an ODBC driver. You must install it yourself. Drivers that are compatible with Excel for Mac 2011 are available from these companies:

OpenLink Software

Actual Technologies

Simba Technologies

After you install the driver for your source, you can use Microsoft Query to create new queries or refresh existing queries that were created in other versions of Excel, such as Excel X, Excel 2004, and Excel for Windows. For more information, see Import data from a database in Excel for Mac 2011.

Excel 2016 for Mac

This version of Excel does provide an ODBC driver for connecting to SQL Server Databases. On the Data tab, click New Database Query > SQL Server ODBC. Then use the dialog boxes to import the data.

If you are connecting to other ODBC data sources (for example, FileMaker Pro), then you'll need to install the ODBC driver for the data source on your Mac. Drivers that are compatible with Excel for Mac are available from these companies:

OpenLink Software

Actual Technologies

Has anyone gotten this to work?

Sorry, I have never used it.

Tags:

Macos

Excel

Vba

Ado