+ Reply to Thread
Results 1 to 4 of 4

Statement: "Application.DisplayAlerts = False" doesn't work for me

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Ottawa, Ontario, Canada
    MS-Off Ver
    Excel 2002
    Posts
    13

    Question Statement: "Application.DisplayAlerts = False" doesn't work for me

    What seemed like an easy task turned into a very difficult one...so I decided to give up and turn to you guys...

    Using Excel 2003, I have a lot of Subs and functions that call each other to generate a complete report. The flow goes as follows:
    1- Menu Bar (that I've created) - click on a button that launches a Sub "Launch1"
    2- Sub "Launch1" opens a Userform(progress bar)
    3- Userform launches another sub "Start1"
    4- Sub "Start1" calls many functions but in it, I have the following code:

    Please Login or Register  to view this content.
    Everything works in this particular macro but the message still pops up "Data may exist in the sheet(s) selected for deletion. To permanently delete the data, press Delete".

    How can I make that pop-up disappear (or automatically "accept" to delete).

    Any help would be appreciated.

    Thanks,

    Alex
    Last edited by CEC; 01-13-2011 at 12:13 PM.

  2. #2
    Registered User
    Join Date
    11-04-2010
    Location
    Ottawa, Ontario, Canada
    MS-Off Ver
    Excel 2002
    Posts
    13

    Re: Statement: "Application.DisplayAlerts = False" doesn't work for me

    I've figured it out.

    Looks like opening another workbook cancels Application.DisplayAlerts so I simply added the code again above Sheets("ABC").Delete
    Last edited by CEC; 01-13-2011 at 11:12 AM.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Statement: "Application.DisplayAlerts = False" doesn't work for me

    Turning alerts off like that should do the trick. Can you attach a sample workbook with it not working?

    You also need to make sure you're turning alerts back on and include error handling that does so should the procedure not execute correctly.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Statement: "Application.DisplayAlerts = False" doesn't work for me

    Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

    Dom

+ 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