logo
search
list

Table of Content

Corriger l’erreur VBA « Automation type not supported » dans Excel pour Mac

Posted by Algirdas Jasaitis

calendar

2026-08-30

views

868

likes

59

Fix "Automation Type Not Supported" VBA Error in Excel for Mac

Resolve the frustrating "Automation type not supported" error in Excel for Mac VBA. Learn why the Mac VBE event list fails and how to manually insert event code.

Dealing with VBA errors on a Mac can be frustrating, especially when your code seems perfectly fine. If you are encountering the "Automation type not supported in Visual Basic" error while trying to build macros in Excel for Mac, you are not alone—and fortunately, the workaround is quick and straightforward.

Problem Description: Mac VBE Event List Error

When trying to select a workbook or worksheet event from the drop-down menus within the Visual Basic Editor (VBE) on macOS, Excel throws a sudden "Automation type not supported" error. Surprisingly, this is not an issue with your actual VBA code or logic, but rather a known bug in the Mac version of the VBA editor's graphical interface failing to generate the event code snippet.

Quick Answer for Excel Mac Automation Errors

Do not use the VBE drop-down menus to generate event stubs. Instead, manually type the exact procedure signature (such as Private Sub Workbook_Open() ... End Sub) directly into the code window, or paste it from a working file.

Likely Causes Behind Visual Basic Mac Bugs

  • VBE Interface Limitations: The Mac version of Excel has historical limitations in its Visual Basic Editor compared to its Windows counterpart. The event drop-down lists often fail to hook into the application's object model correctly.
  • macOS Sandboxing: Apple's strict sandboxing and OS-level automation restrictions can sometimes interfere with legacy VBA UI components attempting to auto-generate code blocks.

Recommended Solution: Bypassing the Editor Interface

  1. Open the Visual Basic Editor (VBE) on your Mac by pressing Option + F11.
  2. In the Project Explorer pane on the left, double-click the specific module where the event belongs (ensure you select ThisWorkbook for workbook events or a specific Sheet module for worksheet events).
  3. Completely ignore the event drop-down menus at the top of the code window.
  4. Manually type the exact event procedure declaration into the blank window. For example:
    Private Sub Workbook_Open()
    ' Your code here
    End Sub
  5. Save your workbook. The code will execute normally when the event is triggered, despite the interface bug.

Alternative Solutions for Cross-Platform VBA Development

  1. Use a Windows Machine for Setup: Create your initial macro workbook on a Windows PC. Use the reliable Windows VBE drop-downs to generate all necessary event stubs, save the .xlsm file, and then seamlessly edit the internal code logic later on your Mac.
  2. Maintain a Code Snippet Library: Keep a separate text file or notes document containing standard Excel event signatures (e.g., Worksheet_SelectionChange, Workbook_BeforeClose) so you can quickly copy and paste them into your Mac VBE without relying on the broken menus.

Working with WPS Office: Cross-Platform Compatibility

Since this automation error is a specific quirk of Microsoft Excel's Mac VBA editor, you might be looking for more streamlined environments. While advanced VBA macros can behave differently across different software suites, WPS Office offers excellent compatibility with Microsoft file formats. If you are frustrated by platform-specific bugs, WPS Office serves as a highly reliable, free alternative for creating, opening, editing, and saving your macro-enabled spreadsheets locally across multiple operating systems.

Prevention Tips for Mac VBA Coding

  • Avoid using the VBE graphical drop-downs for generating events on macOS entirely.
  • Always test your macro-enabled workbooks on both Mac and Windows if you are distributing the file to a diverse user base.
  • Keep your Microsoft Office for Mac installation updated to the latest version, as Microsoft occasionally releases patches for legacy VBE bugs.

FAQs About Excel Mac Visual Basic Issues

Does this error mean my macro code is broken?

No. The error is purely an interface bug in the Mac editor failing to type the code out for you. If you type the code manually and your logic is correct, the macro will run perfectly.

Can I place the manual event code in a standard module?

No. Event codes must be placed in their specific object modules. Workbook events must go in the ThisWorkbook module, and worksheet events must go in their respective Sheet modules. They will not trigger if placed in a standard Module (e.g., Module1).

Algirdas Jasaitis

15 years of office industry experience, tech lover and copywriter. Follow me for product reviews, comparisons, and recommendations for new apps and software.