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

Inserting Endnotes

Endnotes appear at either the end of a section or the end of an entire document. It is just as easy to insert an endnote ...

Discover More

Selective Formatting in Replacements

Do you need to replace text with a term or phrase that uses multiple formats? You can perform this seemingly complex task ...

Discover More

Extra Spaces after Inserting a Building Block

Building blocks are a great tool for inserting standard information in your documents. It is also possible, however, to ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Storing a User's Location before Running a Macro

Macros are often used to process information in a workbook. If your macro makes changes in what is selected in the ...

Discover More

Getting Rid of Alphabetic Characters

When you need to get rid of characters in the middle of a cell value, the best way to do it is through the use of macros. ...

Discover More

Conditionally Displaying a Message Box

You can, from within your macros, easily display a message box containing a message of your choice. If you want to ...

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 5 - 3?

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.