SCENARIO
I don't want to be prompted to overwrite the file if it already exists.
How can I change this macro so that, when pressed, it overwrites the file without prompting the user and waiting for their answer?
SOLUTION
Sub SaveIt() Dim strFirst As String, strLast As String ChDir "C:\Documents and Settings\All Users\Desktop\TNT Desktop Locker\" '***************** Application.DisplayAlerts = False '***************** With Worksheets(1) strFirst = .Range("C4") strLast = .Range("C6") End With ThisWorkbook.SaveAs _ "C:\Documents and Settings\All Users\Desktop\TNT Desktop Locker\" & _ strFirst & " -TNT- " & strLast, xlWorkbookNormal '***************** Application.DisplayAlerts = True '***************** End Sub
SOURCE | LINK (Ozgrid.com) | LANGUAGE | ENGLISH |