+ Reply to Thread
Results 1 to 3 of 3

Application.DisplayAlerts = False showing True

Hybrid View

  1. #1
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327

    Application.DisplayAlerts = False showing True

    Hi All,

    I have

    Application.DisplayAlerts = False
    
    'My code here
    
    Application.DisplayAlerts = True
    However when I hold the cursor over the "False" line in the code the tooltip equates to "True".

    If I add
    Debug.Print Application.DisplayAlerts
    the Immediate window shows "False"

    Why should this be?

    My reason for asking is that I have broken my code up into several separate Subs like

    Sub Total()
    Application.DisplayAlerts = False
    Call Headers
    Call Find
    Call Format
    Call Copy
    Sheets("Unformatted").Delete
    Application.DisplayAlerts = True
    End Sub
    and the prompt window always asks if I'm sure I want to delete that sheet?


    Regards

    Seamus
    Last edited by SOS; 06-27-2008 at 02:33 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This works fine for me, no warning message about deleting the sheet. You don't turn the DisplayAlerts on again in one of the Procedures do you?

    Option Explicit
    
    Sub delSht()
        Sheet1.Delete
    End Sub
    Sub test()
        MsgBox "X"
    End Sub
    Sub main()
        Application.DisplayAlerts = False
        test
        delSht
        Application.DisplayAlerts = True
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Roy,

    You're right. There was indeed a stray DisplayAlerts in one of the Subs. All is well now.

    Thanks

    Seamus

+ 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