+ Reply to Thread
Results 1 to 2 of 2

Prevent two macros from running at the same time

Hybrid View

  1. #1
    Registered User
    Join Date
    06-25-2011
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Prevent two macros from running at the same time

    Hi

    I have scripts running in Outlook based on certain rules that are set up. These scripts take the attachment from an arriving email and saves it to a specific folder.

    I then have an excel macro that runs every 2 minutes. This macro picks up whether there are any new attachements in the folder. If there is, it opens these files and processes the data onto a 'live update screen' that is mounted on our office wall. This macro normally runs for +- 30 seconds.

    With the frequency that the excel macro is running, I am afraid that it might happen where the Excel macro is running when an email arrives and the Outlook scrips then starts processing at the same time.

    Question: How can detect whether or not the Excel macro is running to prevent the Outlook script from running at the same time?

    Your input will be much appreciated.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Prevent two macros from running at the same time

    Hi Kreef

    Perhaps
    Application.EnableEvents = False
     'Do Stuff
    Application.EnableEvents = True
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1