I am trying to move many Excel files using a wildcard from \Output
folder to \Output\Archive
folder. If a file is already present in the Archive folder, it should be overwritten.
This is my code (also shown in the attached image)
Application.DisplayAlerts = False
Dim FSO As Object
Set FSO = CreateObject("scripting.filesystemobject")
FSO.MoveFile Source:=Excel_Path & Excel_Name, Destination:=Excel_Path & "Archive\" & Excel_Name
Application.DisplayAlerts = True
It is still throwing an error
File already exists
Almost everyone suggests to disable the display alert but in my case it is not working.
Am I missing anything here? Can someone help?
TIA,
Sanket K.