Error Creating Event Handlers

Written by Allen Wyatt (last updated June 10, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


When Steve tries to create an event handler, either for a workbook or for a worksheet, he gets an error message: "Variable Uses an Automation Type not Supported in Visual Basic." Excel won't allow the creation of any event handlers, even if Steve saves the workbook in XLSM format. He wonders what causes this error and how he can create the event handlers he needs?

It is not clear from the question which version of Excel Steve is using, but if he is using on a Mac platform, this problem has been known for some time. There is information about the problem here, on this web page:

https://support.microsoft.com/en-us/topic/-c3125bf3-c30b-4d62-be42-d2f1bec0e5ad

It is amazing that Microsoft has known about this problem for at least six years (since 2017) and it still has not been fixed. The web page provides some workarounds for the issue, as well. (And one jaw-dropping workaround is to create your event handler using Excel on a Windows system, and then transfer it to the Mac.)

Head-shaking workarounds aside, it is possible that Steve is experiencing the error on a Windows-based system. If this is the case, then the most likely issue is a problem with a variable defined in some pre-existing event handler or macro already on the system. The way to see if this is the cause is to get out of Excel, rename the personal macro workbook, restart Excel, and see if the problem exists with a new, blank workbook. If it goes away under those conditions, then you know you have some detective work to do in order to track down the problem in one of the macros in the personal macro workbook.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13374) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Moving Items On a Menu

Want your copy of Excel to reflect the way you want to work with the interface? Fortunately, you can modify where various ...

Discover More

Protecting Your Conditional Formatting Rules

If you have conditional formatting applied in a worksheet, the formulas in those formats may not be as secure as you ...

Discover More

Page Counts for Many Documents

Need to see the page count on a large number of documents? Windows provides an easy way to see the information you ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Deleting Worksheet Code in a Macro

When creating an application in VBA for others to use, you might want a way for your VBA code to modify or delete other ...

Discover More

Automatically Enabling Macros for Specific Workbooks

On your system you may have workbooks that contain macros you know are safe to use. Microsoft provides two things you can ...

Discover More

Calling a Subroutine from a UDF

Excel allows you to create a special type of macro called a user-defined function (UDF). These can let you add to the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.