![]() |
re : Possible ???? Pls help
Hi,
I have a private sub name HSAYield in WB1, another private sub name PHCYield in WB2. Is it possible to write a code in WB1 Private Sub HSAYield to activate the private sub PHCYield in WB2??? Thanks |
re : Possible ???? Pls help
Afraid not. Thats what Private means. Read help on Private and Public for
more info "ddiicc" wrote: Hi, I have a private sub name HSAYield in WB1, another private sub name PHCYield in WB2. Is it possible to write a code in WB1 Private Sub HSAYield to activate the private sub PHCYield in WB2??? Thanks |
re : Possible ???? Pls help
while this seemed to be the obvious answer, it is also wrong. sorry. see my
other post too... Sub Book1() Application.Run "Book2!hello2" End Sub "Patrick Molloy" wrote: Afraid not. Thats what Private means. Read help on Private and Public for more info "ddiicc" wrote: Hi, I have a private sub name HSAYield in WB1, another private sub name PHCYield in WB2. Is it possible to write a code in WB1 Private Sub HSAYield to activate the private sub PHCYield in WB2??? Thanks |
re : Possible ???? Pls help
Sub Book1()
Application.Run "Book2!hello2" End Sub "ddiicc" wrote: Hi, I have a private sub name HSAYield in WB1, another private sub name PHCYield in WB2. Is it possible to write a code in WB1 Private Sub HSAYield to activate the private sub PHCYield in WB2??? Thanks |
re : Possible ???? Pls help
Hi Patrick,
I have try the statement u stated below, I have also try using Call but still cannot. "Patrick Molloy" wrote: Sub Book1() Application.Run "Book2!hello2" End Sub "ddiicc" wrote: Hi, I have a private sub name HSAYield in WB1, another private sub name PHCYield in WB2. Is it possible to write a code in WB1 Private Sub HSAYield to activate the private sub PHCYield in WB2??? Thanks |
re : Possible ???? Pls help
From the XL2002 Help file
--------------------------------------------------------------------------------------------------------- Run Method Runs the Microsoft Excel macro at this location. The range must be on a macro sheet. expression.Run(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30) expression Required. An expression that returns a Range object. Arg1-Arg30 Optional Variant. The arguments that should be passed to the function. Run method as it applies to the Application object. Runs a macro or calls a function. This can be used to run a macro written in Visual Basic or the Microsoft Excel macro language, or to run a function in a DLL or XLL. expression.Run(Macro, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30) expression Required. An expression that returns an Application object. Macro Optional Variant. The macro to run. This can be either a string with the macro name, a Range object indicating where the function is, or a register ID for a registered DLL (XLL) function. If a string is used, the string will be evaluated in the context of the active sheet. Arg1-Arg30 Optional Variant. The arguments that should be passed to the function. Remarks You cannot use named arguments with this method. Arguments must be passed by position. The Run method returns whatever the called macro returns. Objects passed as arguments to the macro are converted to values (by applying the Value property to the object). This means that you cannot pass objects to macros by using the Run method. Example This example shows how to call the function macro My_Func_Sum, which is defined on the macro sheet Mycustom.xlm (the macro sheet must be open). The function takes two numeric arguments (1 and 5, in this example). mySum = Application.Run("MYCUSTOM.XLM!My_Func_Sum", 1, 5) MsgBox "Macro result: " & mySum --------------------------------------------------------------------------------------------------------------- "ddiicc" wrote: Hi Patrick, I have try the statement u stated below, I have also try using Call but still cannot. "Patrick Molloy" wrote: Sub Book1() Application.Run "Book2!hello2" End Sub "ddiicc" wrote: Hi, I have a private sub name HSAYield in WB1, another private sub name PHCYield in WB2. Is it possible to write a code in WB1 Private Sub HSAYield to activate the private sub PHCYield in WB2??? Thanks |
All times are GMT +1. The time now is 09:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com