View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Stephen Lloyd[_2_] Stephen Lloyd[_2_] is offline
external usenet poster
 
Posts: 48
Default Determining what menu item called a macro

Thank you both for your responses.

Jim, I had looked at application.caller and thought that it would not return
useful information if vba was called from a menu. I will look at it again
though.

Wigi, thank you for your help as well. I've looked at Mehta's stuff before
and found him helpful.

"Jim Thomlinson" wrote:

Take a look at application.caller
--
HTH...

Jim Thomlinson


"Stephen Lloyd" wrote:

I'm creating an xla that will add a custom menu that will be added to the
main menu bar. My hope is to have several of the menu items actually tied to
the same macro which will run (portions of the) code conditionally based on
the calling menu item.

Is there a property to determine what menu item called a routine? If so,
what is it and are there any limitations I should be aware of? Any
additional information would be awesome...i.e., obect/collection information,
etc.

I didn't find much in Excel's help files.