Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50151

[SOLVED] Remove Message - A File Named X Already Exsists

$
0
0
Good afternoon,

Im trying to dump a file out into a location on the system but keep getting an error saying the file exsists do i want to overwrite it, how do i remove the messages from showing and just to overwrite the exsisting file? I already have
Code:

Application.DisplayAlerts = False
But i still get this message

Code:

Sub Export_SMS_1CLDUETODAY()
'
' Export_SMS_1CLDUETODAY Macro
'

'
    Sheets("1CL Due Today").Select
    Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
    Range("A2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Workbooks.Add
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
    Application.CutCopyMode = False
    ChDir "S:\Planning\Defaults"
    ActiveWorkbook.SaveAs Filename:="S:\Dialler Live\SMS Files\SMS 1st Credit Due Today " & Format(Date, "ddmmyy") & ".csv", _
    FileFormat:=xlCSV, CreateBackup:=False
    Application.DisplayAlerts = False
    ActiveWorkbook.Save
    Application.DisplayAlerts = False
    ActiveWindow.Close
    Sheets("Home").Select
End Sub

Thanks in advance

DJ

Viewing all articles
Browse latest Browse all 50151

Trending Articles