Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling macro from a different moldule
I created 4 different macros in 4 different modules. I like to create one
main macro which calls these 4 modules. I tried to enter the macro names one after another in the new module and it's giving me an error. Do I need to declare the other 4 macros to public? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling macro from a different moldule
If the macros are in a normal module sheet you do not need to declare them as public try Sub MainMacro () Call Macro1 Call Macro2 Call Macro3 Call Macro4 MyInfo = Function5Result End Sub -- mudraker ------------------------------------------------------------------------ mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473 View this thread: http://www.excelforum.com/showthread...hreadid=518093 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling macro from a different moldule
Thanks to your reply. I tied your suggestion but still get an error.
I created the macros in modules. Instead of calling them module1, module2...I renamed the macros. In my main macro, I enter the follwing codes: Sub main() Call DelFre_Keystone Call DelFre_Symmetry Call DelFre_Folio Call RecFre_Keystone Call RecFre_Symmetry Call RecFre_Foli end sub() I get an error "Compile Error" expected variables or procedures, not module "mudraker" wrote: If the macros are in a normal module sheet you do not need to declare them as public try Sub MainMacro () Call Macro1 Call Macro2 Call Macro3 Call Macro4 MyInfo = Function5Result End Sub -- mudraker ------------------------------------------------------------------------ mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473 View this thread: http://www.excelforum.com/showthread...hreadid=518093 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling macro from a different moldule
Sorry, my mistake. I call the module name instead of the name of the sub
procedure. "Vanna" wrote: Thanks to your reply. I tied your suggestion but still get an error. I created the macros in modules. Instead of calling them module1, module2...I renamed the macros. In my main macro, I enter the follwing codes: Sub main() Call DelFre_Keystone Call DelFre_Symmetry Call DelFre_Folio Call RecFre_Keystone Call RecFre_Symmetry Call RecFre_Foli end sub() I get an error "Compile Error" expected variables or procedures, not module "mudraker" wrote: If the macros are in a normal module sheet you do not need to declare them as public try Sub MainMacro () Call Macro1 Call Macro2 Call Macro3 Call Macro4 MyInfo = Function5Result End Sub -- mudraker ------------------------------------------------------------------------ mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473 View this thread: http://www.excelforum.com/showthread...hreadid=518093 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
calling a macro | Excel Programming | |||
Trouble calling macro | Excel Programming | |||
Calling a macro from a key | Excel Programming | |||
Calling Outlook Macro | Excel Programming | |||
Calling macro in add-in. | Excel Programming |