Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to create a Meta-Macro 1

Status
Not open for further replies.

hatman88

Programmer
Aug 22, 2007
16
US
Hello, I have 4 different macros that I want to run in sequence (with some added steps in between). I know how to call other header files and call their Subs, but I want to know how to call their Main Sub. Any help? Thanks in advance.

P.S. There's one macro that I need to call an hour later after one starts. Any help on how to do this?

 
If you need the headers to have their own sub main (they can be ran independently), then you could just move everything that's in the Sub Main to another sub. Then you can call the other sub by name, because you won't have two Sub Mains. (See example below.)

I'm surprise using headers that it doesn't pitch a fit over multiple Sub Mains. Personally, I'd probably chunk everything into a library or libraries, include the libraries, and then it's just the Sub Main that tells it what subs and functions to run.

HeaderFile1
Code:
Sub ExecuteWhatWasInSubMainForHeaderFile1
  'All the old sub main stuff goes here
End Sub

Sub Main
  ExecuteWhatWasInSubMainForHeaderFile1
End Sub

Program that needs to use the header file code.
Code:
Sub IExecuteTheAboveCode
  ExecuteWhatWasinSubMainForHeaderFile1
EndSub

Sub Main
  IExecuteTheAboveCode
End Sub
 
I appreciate your help, but I figured to do that on my own around 2 weeks ago. Thanks anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top