Fix Excel VBA Mac Error 91: CommandBars FindControl Font List Issue
Question details
Users need a way to retrieve the available font list in Excel VBA on Mac without triggering a runtime error.

- Product
- Excel for Microsoft 365 on Mac
- Device & OS
- macOS
- Scenario
- Running a VBA macro to retrieve available font names and apply them to specific worksheet cells.
- Observed behavior
- The macro fails with Run-time error 91 at cbc.ListCount because Application.CommandBars.FindControl(ID:=1728) returns Nothing on modern Mac versions.
Ensure your macOS and Office installations are updated, as legacy VBA CommandBars support was largely deprecated after Office 2011 for Mac.
Use Word Automation to Retrieve Fonts
Since Excel for Mac does not reliably expose the font list via CommandBars, you can instantiate a Word application object in VBA to access its font collection.
Microsoft Word handles fonts slightly differently and exposes a FontNames collection that can be queried from Excel via VBA automation. Note that Word may list some fonts that Excel cannot apply, so error handling is required.
Launch Excel for Mac, open your workbook, and press Option + F11 to open the Visual Basic Editor.
Click Insert > Module from the top menu to create a blank script area for your macro.
Write your subroutine and declare an object variable. Set it using the syntax: Set wd = CreateObject("Word.Application") to launch a background instance of Word.
Create a For loop from 1 to wd.FontNames.Count. Inside the loop, extract each font name using wd.FontNames.Item(fontIndex) and write it to your desired Excel cells.
Wrap the font-applying step with On Error Resume Next and check if Err.Number <> 0. If an error occurs, the font is incompatible with Excel and should be skipped or flagged. Close the Word object with wd.Quit when finished.

Migrate to Modern Ribbon XML
For building custom UI elements on Mac, transition away from legacy CommandBars and utilize Ribbon XML extensibility.
Try WPS Office for Seamless Spreadsheet Management
Dealing with VBA limitations and deprecated APIs in Microsoft Excel for Mac can hinder productivity. WPS Office offers a free, lightweight, and highly compatible alternative for managing complex spreadsheets without the overhead of platform-specific legacy errors.
- 1. Visit the Official Website: Go to the official WPS Office website on your Mac.
- 2. Download the Installer: Click the Free Download button to get the macOS installer package.
- 3. Install and Launch: Open the downloaded package, follow the on-screen instructions, and launch WPS Spreadsheets to start working.

Frequently Asked Questions
Why does CommandBars.FindControl return Nothing on Excel for Mac?
Microsoft deprecated comprehensive support for CommandBars on macOS after Office 2011. Many legacy control IDs, including ID 1728 for the font list, are no longer mapped in modern versions of Excel for Mac, causing the function to return a null object (Nothing).
Do Excel and Word for Mac share the exact same font lists?
Not entirely. While both applications pull from the system fonts, Word can recognize and list certain fonts that Excel's rendering engine cannot support. Attempting to apply these incompatible fonts in Excel via VBA will result in an 'Unable to set the Name property of the Font class' error.
How do I handle missing font errors in my VBA loops?
Use the 'On Error Resume Next' statement immediately before the code line that applies the font name. Check if 'Err.Number' is greater than 0 to detect failures, log the error, and then reset your error handling using 'On Error GoTo 0'.




