Results 1 to 21 of 21

Prevent message boxes from another macro from popping up

Threaded View

  1. #1
    Registered User
    Join Date
    07-03-2013
    Location
    New England
    MS-Off Ver
    Excel 2010
    Posts
    24

    Prevent message boxes from another macro from popping up

    Hey everyone, so I currently have a macro that leads two other codes to run. I put these codes into my current macro using Application.Run. The problem I am running into is that the two macros that I am running contain message boxes within them to let the user know the macro is done. The macro I am working on now is supposed to make the process quicker but when the messages boxes come up and the user has to click ok or hit enter, it adds a lot of time to the process. This script could sometimes be used to run each of the other programs hundreds of times. I have tried putting Application.DisplayAlerts=False into the code so that it prevents these other boxes from appearing, but they still come up. Can anyone help with this? I would get rid of the messages inside the two scripts I am running, but I need those for when they are run on their own. I'll try to explain better below by showing you what I'm working with.

      Application.DisplayAlerts = False
    Do
        Range("I4").Select
        Application.Run "CreateSL"
        Application.Run "NewFileSL"
        Range("I4").Select
        Application.CutCopyMode = False
        Selection.Delete Shift:=xlToLeft
    Loop Until IsEmpty(Cells(4, 9))
    Application.DisplayAlerts = True
    
        
        MsgBox ("The Stock Lists have been saved.")
        Application.ScreenUpdating = True
    Basically I am running two programs based on a list of values that are set in row 4. The values start in cell I4 and carry on to the right. The two macros I am running inside of this one both depend on the value of cell I4. So the code takes the value of I4, runs "CreateSL" and "NewFileSL" and then deletes that cell so that the next item in the list moves into I4. The code does this until I4 is empty. My problem is that both "CreateSL" and "NewFileSL" contain message boxes at the end of their code. I would prefer not to comment out these message boxes each time I want to run this script because they need to be there for times when these scripts are run by themselves.

    Any help is greatly appreciated, thanks.
    Last edited by sczerniak; 07-11-2013 at 11:16 AM. Reason: fixing typo

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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