View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hermac Hermac is offline
external usenet poster
 
Posts: 2
Default Why does this mouse menu call a sub from another workbook?

Hello,

I've been on this problem for more than a day now and I can't figure it
out.
I have a worksheet embedded chart which, on right click, shows a
modified mouse menu, which in turn allows to fire a sub called
"MaakGraf". Like this

Set MenuItem =
Application.CommandBars("Object/plot").Controls.Add(Type:=msoControlButton)
With MenuItem
.Caption = "Maak deze Grafiek"
.OnAction = "MaakGraf"
End With

It worked perfectly until yesterday. But since then, when clicking the
"Maak deze Grafiek" option, I get a prompt to enable or disable the
macro's of an OTHER workbook, to wich there is absolutely no link
although this other workbook is very similar to the active one and has
a sub with the same name. If enabled, the other workbook is opened.

If called with F5 or via the Extra-Macro menu, the sub perfectly refers
to the intended sub in the active workbook.

What am I overlooking here ?

Thank you very much for any help.
Herman