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: 63
Default Application.Run with variable number of arguments

Hello,

I'm trying to create a generic sub that will call Application.Run with a
Worksheet.Module.Sub passed to it and also a variable number of arguments.
Is this possible? For example, if wishing made it so, it would run like
this:

Sub app_run(macro_to_run as string, params as variant)
Application.Run macro_to_run, params
End Sub

In my dreams, I'd call it something like this:

Call app_run("MyBook.xls!MyModule.MyMacro", array("test 1", 1)

And lo and behold MyMacro would run:

Sub MyMacro(str1 as String, lng1 as Long)
....


If that's not possible, is there any way to pass one string to my app_run
sub and have it parsed for the Workbook.Module.Macro and the args, e.g.:

Call app_run(("MyBook.xls!MyModule.MyMacro, test1, 1")

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.run and ByRef arguments AsIs[_3_] Excel Programming 7 November 23rd 06 01:34 PM
Passing Variable Number of Arguments to a Sub blatham Excel Discussion (Misc queries) 4 December 10th 05 10:36 AM
application.dialogs(xlDialogPrint) - arguments David Excel Programming 0 October 17th 05 08:01 AM
writing a Function with a variable number of arguments TonyJeffs Excel Programming 3 June 18th 04 09:01 AM
Question: Macro overloading, passing variable number of arguments Frederik Romanov Excel Programming 1 July 8th 03 02:51 PM


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