Announcement

Collapse
No announcement yet.

Application.DisplayAlerts = False (not working!)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Application.DisplayAlerts = False (not working!)

    I am trying to get this code to work without getting that darn file already exist message. I read through the forum to get any other ideas other than the Application.DisplayAlerts = False, but I am lost...I don't know why the message still appears...anyone? Thanks for your help!


    Code:
     
    Sub saveWkbk()
     '  Macro Recorded by Shawn Lollis
     
        Dim pathStr As String
         
        pathStr = ThisWorkbook.Path
        ActiveWorkbook.SaveAs Filename:=pathStr & "/MON2707.xls"
        Application.DisplayAlerts = False
                msg = "Monday Sales & Control Numbers are now updated."
                msg = msg & Chr(13) & Chr(13)
                msg = msg & "You are ready to e-mail file to Admin. Office."
                msg = msg & Chr(13) & Chr(13) & Chr(13)
                msg = msg & "Press OK to continue."
                Title = "Confirmation of Monday Update"
                Ans = MsgBox(msg, vbExclamation, Title)
        ActiveWorkbook.Close
        Application.Quit
    End Sub

  • #2
    Re: Application.DisplayAlerts = False (not working!)

    Shouldn't you have the code to turn of alerts before the code to save the workbook?
    Boo!

    Comment


    • #3
      Re: Application.DisplayAlerts = False (not working!)

      I believe norie is right on target.

      Also, make sure you turn the alerts back on before you leave the macro (probably should do it as soon as you've finished with the area where you want alerts surpressed. Otherwise Excel will leave them turned off even after the macro has finished.

      Application.DisplayAlerts = True
      Best Regards,
      Tom
      ---------------------------
      Please help Oz share knowledge among all users by posting your questions in a public forum rather than using a Private Message.

      Comment


      • #4
        Re: Application.DisplayAlerts = False (not working!)

        lol...omg...I knew it had to be something simple, but that was it! Thanks a bunch!

        Shawn

        Comment

        Working...
        X