LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default commandbar control and application.caller

I'm trying to write a CommandbarButton OnAction sub that uses
Application.Caller to toggle the state of the button that called it, even if
it's down a couple levels of submenus.

So if I have a toolbar called "toolbar" and a button called "button" that's
in a submenu I'd like to have the .OnAction of "button" be "toggle_button".
Since, as far as I can tell, an onaction macro doesn't take arguments (can
it?), I'd hard-code "toolbar" in the macro and use (I guess)
application.caller to identify the control.
I've tried a few things: "application.parent" isn't valid, unfortunately, or
I could work my way back up through the menus. I've struggled with a
recursive function and a bunch of nested loops, but it's ugly, and I'm
hoping maybe somebody already has a good solution for this.

Does that make any sense? Of course, I don't really care if the solution
involves application.caller or not.

Thanks in advance,

Doug


 
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
Application.Caller Marcelo Excel Discussion (Misc queries) 6 June 23rd 06 03:07 PM
Row = Application.Caller.Row Charles Woll Excel Worksheet Functions 8 February 28th 05 02:04 PM
Application.Caller Mark Worthington Excel Programming 9 February 12th 04 07:32 PM
Application.caller Clark B Excel Programming 2 July 29th 03 11:17 PM
DDE and application.caller help Ross Kaminsky Excel Programming 1 July 17th 03 04:17 PM


All times are GMT +1. The time now is 04:47 AM.

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

About Us

"It's about Microsoft Excel"