Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel To Call Sub and Assign Arguments

Please examine the following statement,

Application.OnTime Now + TimeValue("00:00:01"), "CentrAcroSelection"

How could any arguments (as required) be assigned accordingly ?

Please share your experience.

Regards.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Re : Excel To Call Sub and Assign Arguments

Stringtime = "00:00:01"
STime = TimeValue(Stringtime)
MyProcedure = "CentrAcroSelection"
Application.OnTime Now + STime, MyProcedure

" wrote:

Please examine the following statement,

Application.OnTime Now + TimeValue("00:00:01"), "CentrAcroSelection"

How could any arguments (as required) be assigned accordingly ?

Please share your experience.

Regards.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel To Call Sub and Assign Arguments

Joel, Esq.,

Thank you for responding to the query.

Would like to have called the Sub as if bearing the effects of,

Call CentrAcroSelection(TitleWrap)

Needless to say, TitleWrap is an argument to be processed by the Sub,
CentrAcroSelection.

However, the syntax of OnTime method (shown above) prevents the
assignment of TitleWrap to CentrAcroSelection as it is.

Please extend a helping hand.

Regards.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Re : Excel To Call Sub and Assign Arguments

Use a public variable to pass the parameter

Public MyParameter As String
Sub test()
MyParameter = "abc"
Application.OnTime Now + TimeValue("00:00:5"), "my_Procedure"

End Sub

Sub my_Procedure()

MsgBox (MyParameter)

End Sub



" wrote:

Joel, Esq.,

Thank you for responding to the query.

Would like to have called the Sub as if bearing the effects of,

Call CentrAcroSelection(TitleWrap)

Needless to say, TitleWrap is an argument to be processed by the Sub,
CentrAcroSelection.

However, the syntax of OnTime method (shown above) prevents the
assignment of TitleWrap to CentrAcroSelection as it is.

Please extend a helping hand.

Regards.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel To Call Sub and Assign Arguments

Joel, Esq.,

Thank you again.

"Use a Public Variable" ; that's a viable means indeed.

There appears to be no alternative means (good try aside, but in vain)
to daisy-chain arguments to the following statement,

Application.OnTime Now + TimeValue("00:00:5"), "my_Procedure" & <Daisy-
Chain of Arguments

Regards.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Re : Excel To Call Sub and Assign Arguments

You can make the public variable an array like

Public arg(5) as Variant

Sub Main()

arg(0) = "Hello"
arg(1) = "World"
arg(2) = "Goodbye"
arg(3) = "Joel"
arg(4) = 123
Application.OnTime Now + TimeValue("00:00:5"), "my_Procedure"

End Sub

Sub my_Procedure()

'enter yor code here

End Sub


The above example is very similar to the way Unix, and C language pass
parameters except instead of make the vaiable Publid the variable are pushed
onto a calling stack.


" wrote:

Joel, Esq.,

Thank you again.

"Use a Public Variable" ; that's a viable means indeed.

There appears to be no alternative means (good try aside, but in vain)
to daisy-chain arguments to the following statement,

Application.OnTime Now + TimeValue("00:00:5"), "my_Procedure" & <Daisy-
Chain of Arguments

Regards.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel To Call Sub and Assign Arguments

Joel, Esq.,

Thank you again.

After some search, found the following :-

http://groups.google.com/group/micro...b5a31754f7b7e2

Could be useful reference next. Regards.
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
call a macro with arguments in a Command Button Jeff Excel Programming 1 November 9th 06 07:35 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Does excel acept arguments Roberto Excel Worksheet Functions 1 April 6th 06 07:56 PM
If statement that contains 6+ arguments in excel JimJams Excel Worksheet Functions 1 February 13th 06 11:24 AM
call a sub with arguments from Worksheet_FollowHyperlink event Tom Ogilvy Excel Programming 5 August 28th 03 10:58 PM


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