+ Reply to Thread
Results 1 to 3 of 3

Where to put DisplayAlerts = False

  1. #1
    Joe Fish
    Guest

    Where to put DisplayAlerts = False

    Hi,
    I have tried inserting DisplayAlerts = False all over the following
    block of code , but when I go to delete the sheets, it still asks if I
    want to delete them. Is this not the right syntax or am I doing
    something wrong?
    Thanks,
    Joe Fish

    Sub SetUpScrollerInfo()

    DisplayAlerts = False
    Run ("DeleteOldSheets")
    Run ("MakeNewSheets")
    Run ("ImportData")
    Run ("FormatData")
    Run ("AddToPositionAndUnitNumberFormula")
    Run ("DefineBundles")
    Sheets("Scroller Info").Range("A1").Select

    End Sub
    Sub DeleteOldSheets()

    DisplayAlerts = False
    Sheets("Scroller Info").Delete
    DisplayAlerts = False
    Sheets("Spare Scroller Cables").Delete


  2. #2
    Chip Pearson
    Guest

    Re: Where to put DisplayAlerts = False

    You need to qualify 'DisplayAlerts' with 'Application'. E.g,

    Application.DisplayAlerts = False

    Without the Application qualification, VBA treats 'DisplayAlerts'
    as a variable name, creates the variable, and assigns it a value
    of False. This would be obvious if you properly placed 'Option
    Explicit' at the top of your code module.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com




    "Joe Fish" <joefish534@yahoo.com> wrote in message
    news:1130011561.557023.262460@g43g2000cwa.googlegroups.com...
    > Hi,
    > I have tried inserting DisplayAlerts = False all over the
    > following
    > block of code , but when I go to delete the sheets, it still
    > asks if I
    > want to delete them. Is this not the right syntax or am I doing
    > something wrong?
    > Thanks,
    > Joe Fish
    >
    > Sub SetUpScrollerInfo()
    >
    > DisplayAlerts = False
    > Run ("DeleteOldSheets")
    > Run ("MakeNewSheets")
    > Run ("ImportData")
    > Run ("FormatData")
    > Run ("AddToPositionAndUnitNumberFormula")
    > Run ("DefineBundles")
    > Sheets("Scroller Info").Range("A1").Select
    >
    > End Sub
    > Sub DeleteOldSheets()
    >
    > DisplayAlerts = False
    > Sheets("Scroller Info").Delete
    > DisplayAlerts = False
    > Sheets("Spare Scroller Cables").Delete
    >




  3. #3
    Jim May
    Guest

    Re: Where to put DisplayAlerts = False

    change to:
    Application.DisplayAlerts = False
    Your code....
    Application.DisplayAlerts = True

    "Joe Fish" <joefish534@yahoo.com> wrote in message
    news:1130011561.557023.262460@g43g2000cwa.googlegroups.com...
    > Hi,
    > I have tried inserting DisplayAlerts = False all over the following
    > block of code , but when I go to delete the sheets, it still asks if I
    > want to delete them. Is this not the right syntax or am I doing
    > something wrong?
    > Thanks,
    > Joe Fish
    >
    > Sub SetUpScrollerInfo()
    >
    > DisplayAlerts = False
    > Run ("DeleteOldSheets")
    > Run ("MakeNewSheets")
    > Run ("ImportData")
    > Run ("FormatData")
    > Run ("AddToPositionAndUnitNumberFormula")
    > Run ("DefineBundles")
    > Sheets("Scroller Info").Range("A1").Select
    >
    > End Sub
    > Sub DeleteOldSheets()
    >
    > DisplayAlerts = False
    > Sheets("Scroller Info").Delete
    > DisplayAlerts = False
    > Sheets("Spare Scroller Cables").Delete
    >




+ 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