error 1004 "Cannot edit a macro ..."

D

David

I've written an addin that from workbook_open calls an
addmenu sub that builds a custom menu. The addmenu sub has
the line

Application.MacroOptions Macro:="GICreateToolbar",
HasShortcutKey:=True, ShortcutKey:="t"

This line causes a problem when you start Excel by double
clicking a file containing a macro. You get the error

"Runtime error 1004 Cannot edit a macro on a hidden
workbook. Unhide the workbook using the unhide command"

How do I avoid this error without having to remove my
shortcut?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top