How to Reference an Excel Form Control List Box in VBA on Mac
Question details
The user needs to reference an Excel Form Control list box using VBA specifically on a Mac environment.

- Product
- Microsoft Excel
- Device & OS
- macOS
- Scenario
- Writing VBA macros to interact with Excel list boxes on a Mac, where ActiveX controls are unsupported.
- Observed behavior
- Standard ActiveX list box event syntax does not work on Mac. Users must instead access list boxes via the Shapes collection and ControlFormat object.
Ensure you have the Developer tab enabled in your Mac Excel ribbon and verify that you are using Form Controls, as ActiveX controls are entirely unsupported on macOS.
Use the Shapes Collection and Application.Caller
The standard approach to manipulate Form Controls on a Mac is to assign a standard macro and dynamically identify the clicked list box using Application.Caller.
Because ActiveX controls are strictly Windows-only, macOS Excel exclusively relies on Form Controls. Instead of relying on automatic event handlers like ListBox1_Click, you must manually assign a specific macro to your Form Control list box.
Within your macro, the Application.Caller method captures the exact name of the control shape that triggered the code. You can then reference and manipulate the list box via the ControlFormat property.
Right-click (or Control-click) the Form Control list box on your Excel worksheet and select 'Assign Macro' from the context menu.
Click 'New' in the dialog box to open the VBA Editor and generate a new module procedure for this specific list box.
In the VBA editor, write your code using ActiveSheet.Shapes(Application.Caller).ControlFormat to dynamically reference the exact list box that was clicked.
Alternatively, if your list box has a specific name like 'Bison', you can reference it directly anywhere in your code using Worksheets("Work").Shapes("Bison").ControlFormat.

Use WPS Spreadsheet for Robust VBA & Macro Integration
WPS Spreadsheet offers comprehensive VBA support and an intuitive Developer tab, making it easy to create, manage, and write macros for Form Controls effortlessly across your documents.
- 1. Enable the Developer Tab: Open WPS Spreadsheet, go to the Options menu, and enable the 'Developer' tab so it appears on your main ribbon.
- 2. Insert a Form Control: Click on 'Insert' in the Developer tab and select the 'List Box' icon under the Form Controls section.
- 3. Assign a Macro: Draw the List Box on your spreadsheet, then right-click it to choose 'Assign Macro'.
- 4. Edit VBA Code: Use the integrated WPS VBA editor to write your standard cross-platform macros securely and easily.

Frequently Asked Questions
Why do I get an error when using ActiveX controls on my Mac?
ActiveX controls rely on built-in Windows OS system libraries and COM architecture that are fundamentally unavailable on macOS. To build cross-platform or Mac-compatible Excel files, you must use Form Controls.
How do I rename a Form Control list box in Excel?
Click on the list box to select it, then click inside the Name Box located to the left of the formula bar. Type your new custom name (e.g., 'frog') and press Enter.
Can I use ListBox_Click() events on macOS?
No, ListBox_Click() is an event handler specific to ActiveX controls. On Mac, you must assign a standard macro to the Form Control and use Application.Caller to identify and handle user interactions.
How do I get the selected value from a Form Control list box in VBA?
You can find the selected index using the ControlFormat.Value property. To retrieve the actual text string selected, use that index against the list box's ControlFormat.List property or reference its linked cell.




