none
Excel 2016: "DisplayAlerts=True" does not work RRS feed

  • Question

  • Hi,

    A friend of mine told me "DisplayAlerts = True" did Not work in Excel 2016, i.e. confirmation dialog does not appear on deleting a worksheet. I've made a simple VBA with Excel 2016 and affirmed it's true.
    With Excel 2013 it works fine as I expect, but Excel 2016 does Not.

    I'd like to know why "DisplayAlerts = True" does not work with Excel 2016.

    The below is a sample Excel file with macro for checking the function of "DisplayAlerts".
    Excel_2016_DisplayAlerts.xlsm

    Best regards,


    • Edited by Ashidacchi Friday, January 15, 2016 7:01 AM
    Friday, January 15, 2016 6:59 AM

Answers

  • Hi Ashidacchi,

    I made a test with ActiveSheet.Delete method, and I could reproduce your issue under Excel 2016.

    For this issue, I suggest you submit a feedback in the link below:
    https://excel.uservoice.com/

    For a workaround, I suggest you create a custom dialog to display alerts before you call delete worksheet.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by Ashidacchi Monday, January 18, 2016 5:19 AM
    Monday, January 18, 2016 3:08 AM

All replies

  • Re:  displayalerts

    Try it like this...  Application.DisplayAlerts = True

    '---
    Jim Cone
    Portland, Oregon USA
    free & commercial excel programs  (xl97 to xl2010 only)
    https://www.dropbox.com/sh/ttybwg5e9r31twa/AAAnyBTHPX5XsTDp10ItTcw4a?dl=0


    • Edited by James Cone Wednesday, September 21, 2016 11:03 PM
    Friday, January 15, 2016 7:31 PM
  •   

    Hi James,

    Thank you for reply.
    I've used "Application.DisplayAlerts = True".

    The below ZIP is my test Excel file. Please save in your local drive and unzip, and then open it  with Excel 2016.
    (It cannot be run in the cloud, for it includes macro.)
    Excel_2016_DisplayAlerts.zip



    === code in UserForm1 ===

    ' --- [delete worksheet] button ---
    Private Sub btn_Delete_WorkSheet_Click()
        If cmb_Worksheet_Name.Text = "" Then
            MsgBox "No work sheet selected"
            Exit Sub
        End If
        ' ---
        If Worksheets.Count = 1 Then
            btn_Delete_WorkSheet.Visible = False
        Else
            btn_Delete_WorkSheet.Visible = True
            Call rbt_True_Change
            Worksheets(cmb_Worksheet_Name.Text).Delete ' -- delete a worksheet
            Call Module1.prc_Refresh_ComboBox     ' -- adding sheet-name in ComboBox
        End If
    End Sub
    ' ---
    Private Sub btn_Refresh_ComboBox_Click()
        Call Module1.prc_Refresh_ComboBox     ' -- adding sheet-name in ComboBox
    End Sub
    ' ---
    Private Sub rbt_True_Change()
        If rbt_True.Value = True Then
            Application.DisplayAlerts = True
            lbl_DisplayAlerts.Caption = "Application.DisplayAlerts = True"
            lbl_DisplayAlerts.ForeColor = RGB(0, 0, 255)   ' -- Blue
        Else
            Application.DisplayAlerts = False
            lbl_DisplayAlerts.Caption = "Application.DisplayAlerts = false"
            lbl_DisplayAlerts.ForeColor = RGB(255, 0, 0)   ' -- Red
        End If
    End Sub
    === code in Module 1 ===
    ' --- Auto Run at opening Workbook
    Private Sub Auto_Open()
        ' ========================
        UserForm1.rbt_True.Value = True
        Application.DisplayAlerts = True
        ' ========================
        Call prc_Refresh_ComboBox  ' -- adding Sheet Names in ComboBox
        UserForm1.Show vbModeless
    End Sub
    
    ' --- adding Sheet Names in ComboBox
    Public Sub prc_Refresh_ComboBox()
        ' --- deleting items in ComboBox
        UserForm1.cmb_Worksheet_Name.Clear
        ' --- adding sheet name in ComboBox
        Dim mySheet As Worksheet
        With UserForm1.cmb_Worksheet_Name
            For Each mySheet In Worksheets
                .AddItem (mySheet.Name)
            Next
        End With
    End Sub

    Best regards,



    • Edited by Ashidacchi Saturday, January 16, 2016 1:23 AM
    Saturday, January 16, 2016 12:24 AM
  • Ashidacchi,
    Re:  xl2016

    I don't have xl2016.  Someone else will have to give the code  a try.
    '---
    Jim Cone
    Saturday, January 16, 2016 1:40 AM
  • Hi Ashidacchi,

    I made a test with ActiveSheet.Delete method, and I could reproduce your issue under Excel 2016.

    For this issue, I suggest you submit a feedback in the link below:
    https://excel.uservoice.com/

    For a workaround, I suggest you create a custom dialog to display alerts before you call delete worksheet.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by Ashidacchi Monday, January 18, 2016 5:19 AM
    Monday, January 18, 2016 3:08 AM
  • Hi Edward,

    Thank you very much for your testing and suggestion.
    I'll submit a feedback to "Excel UserVoice".

    Best regards,

    Hideki ASHIDA

    Monday, January 18, 2016 4:17 AM
  • Hi Ashidachi,

    Do you have any other issues? If not, I suggest you mark the helpful reply as answer to close this thread.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, January 18, 2016 5:07 AM
  • Hi James

    I manage the engineering team that is responsible for identifying and assigning resources to look at these issues. We have reproduced this issue and have assigned it to another team for prioritization and potential bug fix and patching.

    Thanks for reporting the issue and helping other customers in the process too. I have no ETA or any other information on this issue at present.

    Thanks

    Keith McGuinness(Microsoft)

    Tuesday, January 26, 2016 11:06 PM
  • Hi,

    Any news about the problem? It's still not working.

    Best regards

    Wolfgang

    Wednesday, August 10, 2016 8:30 AM
  • It's November of 2017.

    I am using Excel 2016, and every time I try to suppress excel generated dialogs with

    Application.DisplayAlerts = False....this does not work.

    Will there be a patch for this? It seems to be left in the dirt....

    Over a year for a patch for this? I know there have been many updates. Please fix.

    -s

    Tuesday, November 14, 2017 11:42 AM
  • Hi sephult,

    You need to provide your code. It will be helpful for us to understand your issue.

    Regards,

    Ashidacchi

    Tuesday, November 14, 2017 11:52 AM
  • It's November of 2017.

    I am using Excel 2016, and every time I try to suppress excel generated dialogs with

    Application.DisplayAlerts = False....this does not work.

    Will there be a patch for this? It seems to be left in the dirt....

    Over a year for a patch for this? I know there have been many updates. Please fix.

    -s

    Does not work for me either. Neither does Application.ScreenUpdating. This is completely unacceptable. This problem was reported over a year ago, and still no fix from Microsoft. What was the point of paying to upgrade? I have hundreds of spreadsheets that run unattended and cannot stop for user input. The reply below (by Ashidacchi) is RIDICULOUS - why does code need to be submitted ****AGAIN***? Read the entire thread, this has been identified and acknowledged already as a BUG.

    ***FIX IT****


    Tuesday, November 21, 2017 8:34 PM
  • @vettelover61,

    Thanks.
    But this thread started on Friday, January 15, 2016 6:59 AM (about two years ago), and has been closed.

    Don't forget to confirm date and status of a thread you are reading.

    Regards,

    Ashidacchi


    • Edited by Ashidacchi Wednesday, November 22, 2017 12:51 AM
    Wednesday, November 22, 2017 12:51 AM