Application.OnKey Macro Cannot be found

R

RB Smissaert

Have an .xla add-in that is opened but not loaded (not ticked under Tools,
Add-ins).
In the Workbook_Open event I run a Sub to create a menu and this Sub sets
some
keyboard shortcuts like this:

Application.OnKey "^+v", "Macro1"

Macro1 is in a normal code module.

When I do the keyboard shortcut I get the exact message:
The macro "C:\ExcelAddins\Reporting.xla'!Macro1' cannot be found.

I also tried to fully set the macro like this:
Application.OnKey "^+v", "Reporting.xla!Module1.Macro1"

But same result.
The file is present in the folder, the .xla file is open,the macro is
present in
a normal module, so what causes the above message?
I had this working fine before and no idea why it is not now.

Thanks for any advice.


RBS
 
R

RB Smissaert

No progress with this yet, but now had one occasion where I got this same
error message (but for a different procedure) where there was no keyboard
shortcut involved at all.
It happened when a Sub was called by another Sub.
Couldn't reproduce it after. Have run Detect and Repair in case that would
do any good, but made no difference
on the OnKey procedure.
Any insight/advice in this greatly appreciated.

RBS
 
R

RB Smissaert

Where are these keyboard shortcuts stored?
Is it in the registry or the .olb file?
I have renamed the .olb file, but it made no difference.

RBS
 
R

RB Smissaert

Finally solved this problem.
It had to do with the fact that another open workbook had a Sub with the
same name.
Not sure how this could cause trouble as the workbook was specified with the
OnKey.
Also didn't come across this possibility in my searches, but pleased this is
solved.

RBS
 

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

Top