Shouldn't you have the code to turn of alerts before the code to save the workbook?
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!
VB: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
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
Please help Oz share knowledge among all users by posting your questions in a public forum rather than using a Private Message.
There are currently 1 users browsing this thread. (0 members and 1 guests)