+ Reply to Thread
Results 1 to 2 of 2

Disable prompt when deleting sheets in VBA not working

Hybrid View

desonny Disable prompt when deleting... 01-25-2017, 12:38 PM
Richard Buttrey Re: DisplayAlerts=False not... 01-25-2017, 12:53 PM
  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2003
    Posts
    8

    Disable prompt when deleting sheets in VBA not working

    Hi everybody,

    I've been looking since a long time to find what's going wrong, but can't find out what I'm doing wrong.
    I want to disable the prompt when deleting sheets in my workbook, but I still get a prompt for deleting the sheets even if Application.DisplayAlerts = False is in my code.

    Any suggestions how I can fix this ?

    Thx !

    This is my code:


    Sub KopieerVorigePrestatiestaatTabblad()
    
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False If FileExists = True Then
    
    Set BR = Workbooks.Open(BRPath & BRName)
    
    BR.Sheets(ControlPanel.ComboBoxMaand.Value).Copy Before:=Prestatiestaat.Sheets("Blad1")
    BR.Close (False)
    
    Prestatiestaat.Sheets("Blad1").Delete
    Prestatiestaat.Sheets("Blad2").Delete
    Prestatiestaat.Sheets("Blad3").Delete
    
    Prestatiestaat.Sheets(ControlPanel.ComboBoxMaand.Value).Name = ControlPanel.ComboBoxMaand.Value & " (BASIS)" 'hernoem het tabblad
    
    'BreakLinks 'Wordt in volgende stap gedaan
    
    Else
    
    MsgBox ("Kan prestatiestaat niet maken omdat bestand Basisrooster " & ControlPanel.ComboBoxAfdeling & " " & ControlPanel.ComboBoxJaartal & " niet kan gevonden worden.")
    End
    
    End If
    
    Application.DisplayAlerts = True
    
    End Sub
    Last edited by desonny; 01-25-2017 at 05:27 PM. Reason: adjustment according to forum rules

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: DisplayAlerts=False not working when deleting sheet

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.


    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] All in one line of code: ScreenUpdating=False, Calculation=Manua, DisplayAlerts=False
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2016, 03:10 PM
  2. DisplayAlerts = False not working for formula that points to a missing tab
    By iggydfrog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2012, 05:30 PM
  3. [SOLVED] Disable Run-Time Errors "Application.DisplayAlerts = False" Not Working
    By Punx in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-12-2012, 03:03 PM
  4. Application.DisplayAlerts = False
    By Jim May in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-18-2006, 12:35 PM
  5. Where to put DisplayAlerts = False
    By Joe Fish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2005, 05:05 PM
  6. DisplayAlerts = false not working
    By Mark Stephens in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-13-2005, 02:05 AM
  7. [SOLVED] DisplayAlerts and ScreenUpdate will not set to False
    By Joe at Baso in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-05-2005, 03:06 PM

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