Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do you add arguments to an OnAction event?

I'd like to add an argument to an Onaction sub, which is
associated with a button? Can I?

Sub DoThis(strArg as String)
....
End Sub

Dim b as CommandBarButton
b.OnAction ="DoThis" *** THEN WHAT ***


Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default How do you add arguments to an OnAction event?

Hi Jason,

Yes, you can do this. You can add the string to the Parameter property of
the CommandBarButton. Then, in your subroutine specified by the OnAction
property, you can check the Parameter property of the "clicked" button with
Application.CommandBars.ActionControl.Parameter.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Jason wrote:
I'd like to add an argument to an Onaction sub, which is
associated with a button? Can I?

Sub DoThis(strArg as String)
....
End Sub

Dim b as CommandBarButton
b.OnAction ="DoThis" *** THEN WHAT ***


Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default How do you add arguments to an OnAction event?

.OnAction = "'DoThis ""TestString""'"

"Jason" wrote in message
...
I'd like to add an argument to an Onaction sub, which is
associated with a button? Can I?

Sub DoThis(strArg as String)
....
End Sub

Dim b as CommandBarButton
b.OnAction ="DoThis" *** THEN WHAT ***


Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do you add arguments to an OnAction event?

Note that this undocumented feature appears to not be supported in xl2002.
I believe it may have problems in the latest service release of xl2000 as
well. At least that is what I recall has been reported here.

--
Regards,
Tom Ogilvy

"Tim Zych" wrote in message
...
.OnAction = "'DoThis ""TestString""'"

"Jason" wrote in message
...
I'd like to add an argument to an Onaction sub, which is
associated with a button? Can I?

Sub DoThis(strArg as String)
....
End Sub

Dim b as CommandBarButton
b.OnAction ="DoThis" *** THEN WHAT ***


Thanks






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How do you add arguments to an OnAction event?

Didn't know that. Thanks for the update.

-----Original Message-----
Note that this undocumented feature appears to not be

supported in xl2002.
I believe it may have problems in the latest service

release of xl2000 as
well. At least that is what I recall has been reported

here.

--
Regards,
Tom Ogilvy

"Tim Zych" wrote in message
...
.OnAction = "'DoThis ""TestString""'"

"Jason" wrote in

message
...
I'd like to add an argument to an Onaction sub, which

is
associated with a button? Can I?

Sub DoThis(strArg as String)
....
End Sub

Dim b as CommandBarButton
b.OnAction ="DoThis" *** THEN WHAT ***


Thanks






.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default How do you add arguments to an OnAction event?

I had the same problem: works in older Excel version

-----Original Message-----
Didn't know that. Thanks for the update.

-----Original Message-----
Note that this undocumented feature appears to not be

supported in xl2002.
I believe it may have problems in the latest service

release of xl2000 as
well. At least that is what I recall has been reported

here.

--
Regards,
Tom Ogilvy

"Tim Zych" wrote in message
...
.OnAction = "'DoThis ""TestString""'"

"Jason" wrote in

message
...
I'd like to add an argument to an Onaction sub,

which
is
associated with a button? Can I?

Sub DoThis(strArg as String)
....
End Sub

Dim b as CommandBarButton
b.OnAction ="DoThis" *** THEN WHAT ***


Thanks






.

.

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
Macro - onAction arguments version83 Excel Worksheet Functions 2 April 10th 10 09:59 PM
Event hundler to control the Excel function arguments Yattabi Excel Worksheet Functions 0 December 6th 04 10:41 PM
Passing ARGUMENTS between event procedures of a USERFORM jason Excel Programming 8 November 10th 03 07:36 PM
call a sub with arguments from Worksheet_FollowHyperlink event Tom Ogilvy Excel Programming 5 August 28th 03 10:58 PM
OnAction Richard Yang Excel Programming 1 July 15th 03 01:37 PM


All times are GMT +1. The time now is 11:45 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"