run macro from macro (sounds simple?)

Directlinq

Registered User.
Local time
Today, 11:07
Joined
Sep 13, 2009
Messages
67
Hi it might sound a simple question, but is it possible to run a macro stopping the original macro that is running.

A Call command runs the macro in a macro then returns to the original macro.

This is because i got a strange predicament. I have a code that does a lot of different things and at the end of the code it stops an sql service, copys a file and then starts the sql server again.

If i run the whole code it will stop the sqlserver but it will never restart again until i log off and back on again.

But if i run just the end part where it stops the sql seerver copys the file and starts the sqlserver again it works perfectly everytime.

Wierd. So this is hopefully a way arround it.

Many Thanks
 
vba

Many Thanks
 
In VBA to "call" (run) another sub or a function (that does not return a value), try using:

Code:
Call YourSubANmeHere

Sounds like it may be a timing issue. I would break up the code into two subs, Call the first one, "wait", then call the second one.
 
Last edited:
Using Call returns the the original macro when the called macro has finished.
I need to start a macro without returning to the original macro.

Sounds liek it may be a timing issue. I would break up the code into two subs, Call the first one, "wait", then call the second one.

I have also tried that but no luck

Many Thanks
 
I need to start a macro without returning to the original macro
:confused:
In Access they are different types of objects. They are not the same thing in Access. While in Word and Excel Macros the same as VBA code. Word and Excel really do not have Macros, but access does.

Are you using Macros or VBA code? Or do you have Macros that call VBA routines?
 
Sorry i keep saying macros. I am only using vba routines.
Many thanks
 
Can you not put a boolean flag in the code at a certain point that will skip the offending code if value is True/False?

Can you show the program flow

David
 

Users who are viewing this thread

Back
Top Bottom