Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Using Caller with sub-menu selection in 2007

I use the Application.Caller to return the menu item from a menu containing
sub-menus that each use the same macro function. While the upper level items
still work, there is no longer any differentiation for the sub-menu items.
Code did work for 2003 and earlier but not for 2007. Have I missed something ?

dim c as variant
c= Application.Caller
if c(4)= 0 then ' menu item
'select actual course of action
select case c(1)
case 1
case 2
case else
end select
elseif c(4) = 11 then ' 11th item in menu is a sub-menu
'select actual course of action for sub-menu
select case c(1)
case 1
case 2
case else
end select
endif

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Using Caller with sub-menu selection in 2007


I don't use XL2007, but the "ActionControl" property may still work.
Give it a try.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Kevin Beckham"
wrote in message
I use the Application.Caller to return the menu item from a menu containing
sub-menus that each use the same macro function. While the upper level items
still work, there is no longer any differentiation for the sub-menu items.
Code did work for 2003 and earlier but not for 2007. Have I missed something ?

dim c as variant
c= Application.Caller
if c(4)= 0 then ' menu item
'select actual course of action
select case c(1)
case 1
case 2
case else
end select
elseif c(4) = 11 then ' 11th item in menu is a sub-menu
'select actual course of action for sub-menu
select case c(1)
case 1
case 2
case else
end select
endif

TIA
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Using Caller with sub-menu selection in 2007

Thanks Jim

I didn't want to have to set a different ActionContol (and hence different
processing procedure) for each menu item, 30-40 including sub-menus, as the
handling is essentially the same. The code still works for the items on the
menu but not for item on sub-menus, i.e. Caller is broken in 2007

Kevin

"Jim Cone" wrote:


I don't use XL2007, but the "ActionControl" property may still work.
Give it a try.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Kevin Beckham"
wrote in message
I use the Application.Caller to return the menu item from a menu containing
sub-menus that each use the same macro function. While the upper level items
still work, there is no longer any differentiation for the sub-menu items.
Code did work for 2003 and earlier but not for 2007. Have I missed something ?

dim c as variant
c= Application.Caller
if c(4)= 0 then ' menu item
'select actual course of action
select case c(1)
case 1
case 2
case else
end select
elseif c(4) = 11 then ' 11th item in menu is a sub-menu
'select actual course of action for sub-menu
select case c(1)
case 1
case 2
case else
end select
endif

TIA

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop dwn menu. Formula to count selection frm menu in anoth cell? ggoldber Excel Worksheet Functions 1 June 4th 08 02:21 PM
Chart Selection - Excel 2007 copy to Powerpoint 2007 GS80 Charts and Charting in Excel 1 February 7th 08 01:30 PM
Menu Selection as an Event Al Excel Programming 2 October 26th 07 01:46 PM
if selection from drop down menu = X, then... [email protected] Excel Programming 1 December 15th 06 12:31 AM
Disable menu selection andy Excel Discussion (Misc queries) 3 December 10th 04 10:46 PM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"