Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to stop other macros while current macro runs
I have several macros running, and occasionally it seems that one won't finish because another has placed a value it wasn't expecting and generates an error. Is there code I can place in the begining that will halt all other macros, then turn them back on at the end? On another note, does anyone know a good link that goes over some of the basics of VBA? I could use a course on the basics. THanks -Paul -- Paul987 ------------------------------------------------------------------------ Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850 View this thread: http://www.excelforum.com/showthread...hreadid=535505 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to stop other macros while current macro runs
If you put error trapping in your code (there are plenty of posts on this subject) when the error occurs control will pass to the error handling code rather than just crashing. HAve a look in this forum and in the help files. If you get stuck post again. Things to look for: - on error goto label err.number err.description resume label have fun -- tony h ------------------------------------------------------------------------ tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074 View this thread: http://www.excelforum.com/showthread...hreadid=535505 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to stop other macros while current macro runs
In general, macros run sequentially, not concurrently - that is, they run one
at a time and if they call another, they pause until the one that was called returns its result (there are exceptions, like the OnTime procedure and certain event procedures, but I doubt that is what you have). So I don't think it is a matter of timing between macros. It is the fact that you are getting unexpected results. Good code has to be able to anticipate problems and possible "bad" input so it does not crash with an error. But it is part of the learning curve we all go through. The best thing to do is learn how to use the debug functions in the VBA editor, especially how to step through code and test the values of your variables along the way. A look in the VBA editor help file will give you some info - and a good book on learning vba - there are many out there. -- - K Dales "Paul987" wrote: I have several macros running, and occasionally it seems that one won't finish because another has placed a value it wasn't expecting and generates an error. Is there code I can place in the begining that will halt all other macros, then turn them back on at the end? On another note, does anyone know a good link that goes over some of the basics of VBA? I could use a course on the basics. THanks -Paul -- Paul987 ------------------------------------------------------------------------ Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850 View this thread: http://www.excelforum.com/showthread...hreadid=535505 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs | Setting up and Configuration of Excel | |||
I need a macro that runs other macros until P5=28 | Excel Discussion (Misc queries) | |||
One macro runs then it auto runs another macro | Excel Discussion (Misc queries) | |||
How to stop file open macro prompt after deleting all macros? | Excel Worksheet Functions | |||
How do I stop macro alerts for a spreadsheet with no macros in it | Excel Discussion (Misc queries) |