Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Passing Parameter with OnAction

How do I pass a parameter to a Sub from OnAction?

<button id="btnTest" label="Test Switchboard" size="large"
onAction="Switchboard" /

I have an AddIn that was written for Exce 2000 that I am trying to
migrate to 2007. In it are sveral procedures that are called by other
processes and/or menu buttons.

Since I have to have to add : "control As IRibbonControl" to each
procedure, how do I use the same procedure throughout the application
and still call them from the ribbon?

It seems to me the easiest way, is to pass a parameter to a
swithchboard that tells me which button was clicked then call the
procedure from the switchboard. This way the actual procedure remains
unchanged.

Excel 2007

Thanks
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Passing Parameter with OnAction

goshute used his keyboard to write :
How do I pass a parameter to a Sub from OnAction?

<button id="btnTest" label="Test Switchboard" size="large"
onAction="Switchboard" /

I have an AddIn that was written for Exce 2000 that I am trying to
migrate to 2007. In it are sveral procedures that are called by other
processes and/or menu buttons.

Since I have to have to add : "control As IRibbonControl" to each
procedure, how do I use the same procedure throughout the application
and still call them from the ribbon?

It seems to me the easiest way, is to pass a parameter to a
swithchboard that tells me which button was clicked then call the
procedure from the switchboard. This way the actual procedure remains
unchanged.

Excel 2007

Thanks
Mike


Try putting the parameter in the 'Tag' OR 'Parameter' property. Then
have your procedure query the parameter. More appropriately, use an
entry-point procedure for each button and have the entry-point
procedure pass any parameters required by the called procedure. This
way, your processes are reusable since they require a caller because
they are never run directly from a button. I store entry-point
procedures in a standard module named "mEntryPoints". I store my
process procedures in whatever module they best fit (Context-wise).

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Passing Parameter with OnAction

On Jul 16, 1:48*pm, GS wrote:
goshute used his keyboard to write :





How do I pass a parameter to a Sub from OnAction?


<button id="btnTest" label="Test Switchboard" size="large"
onAction="Switchboard" /


I have an AddIn that was written for Exce 2000 that I am trying to
migrate to 2007. In it are sveral procedures that are called by other
processes and/or menu buttons.


Since I have to have to add : "control As IRibbonControl" to each
procedure, how do I use the same procedure throughout the application
and still call them from the ribbon?


It seems to me the easiest way, is to pass a parameter to a
swithchboard that tells me which button was clicked then call the
procedure from the switchboard. This way the actual procedure remains
unchanged.


Excel 2007


Thanks
Mike


Try putting the parameter in the 'Tag' OR 'Parameter' property. Then
have your procedure query the parameter. More appropriately, use an
entry-point procedure for each button and have the entry-point
procedure pass any parameters required by the called procedure. This
way, your processes are reusable since they require a caller because
they are never run directly from a button. I store entry-point
procedures in a standard module named "mEntryPoints". I store my
process procedures in whatever module they best fit (Context-wise).

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -

- Show quoted text -


Thanks works great.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Passing Parameter with OnAction

You're welcome! Glad to help...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
Passing several parameters to OnAction property. LABKHAND Excel Discussion (Misc queries) 1 April 24th 09 08:02 PM
.onaction, passing arguments Neal Zimm Excel Programming 10 July 6th 07 04:46 PM
Buttons, onAction and Parameter [email protected] Excel Programming 2 January 19th 05 09:31 AM
passing parameters to OnAction Michel Pierron Excel Programming 8 October 29th 04 11:59 PM
Passing Parameters through OnAction Mark Bigelow Excel Programming 3 September 10th 03 12:53 AM


All times are GMT +1. The time now is 07:26 AM.

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"