Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs Rruffpaw Setting up and Configuration of Excel 1 September 17th 11 01:25 PM
I need a macro that runs other macros until P5=28 Jeff Excel Discussion (Misc queries) 6 May 7th 08 11:44 PM
One macro runs then it auto runs another macro PG Excel Discussion (Misc queries) 2 September 1st 06 09:30 PM
How to stop file open macro prompt after deleting all macros? twor57 Excel Worksheet Functions 2 November 29th 05 05:00 PM
How do I stop macro alerts for a spreadsheet with no macros in it DKS044 Excel Discussion (Misc queries) 1 June 23rd 05 03:53 PM


All times are GMT +1. The time now is 05:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"