Results 1 to 2 of 2

Disable prompt when deleting sheets in VBA not working

Threaded View

  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

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