You can first check whether the target directory exists, the program can create the directory
Mkdir App.Path + "\directory"' There is an error and continue to the next sentence
FileCopy the original file, App.Path + "\directory"&"\new name"
Judge the existence of the file before FileCopy
Use FileExists(path+file name) to return boolean
Use the function to build a multi-level directory
Public Function MakeDir(Path As String) As Boolean
On Error Resume Next
Dim o_strRet As String
Dim o_intItems As Integer
Dim o_vntItem As Variant
Dim o_strItems() As String
o_strItems() = Split(Path, "\")
o_intItems = 0
For Each o_vntItem In o_strItems()
o_intItems = o_intItems + 1
If o_intItems = 1 Then
o_strRet = o_vntItem
Else
o_strRet = o_strRet&"\"&o_vntItem
MkDir o_strRet
End If
Next
MakeDir = (Err.Number = 0)
End Function