Em có đoan code...coppy/paste file..
Chay báo ok...nhưng không thấy file coppy đâu
Có ai biết tại sao..chỉ em với...
Các anh cho em xin đoạn code đổi tên file sau khi coppy...
Chào thân ái....!!!
Chay báo ok...nhưng không thấy file coppy đâu
Mã:
Sub Tao_file()
Dim FSO As Object
Dim sFile1 As String
Dim From_path1 As String
Dim To_path As String
Dim path_name As String
'This is Your File Name which you want to Copy
sFile1 = "abc.xlsx"
'Change to match the source folder path
From_path1 = "C:\"
'Change to match the destination folder path
To_path = "C:\"
'Create Object
Set FSO = CreateObject("Scripting.FileSystemObject")
'Checking If File Is Located in the Source Folder
If Not FSO.FileExists(From_path1 & sFile1) Then
MsgBox "Specified File Not Found", vbInformation, "Not Found"
'Copying If the Same File is Not Located in the Destination Folder
ElseIf FSO.FileExists(From_path1 & sFile1) Then
FSO.CopyFile (From_path1 & sFile1), From_path1, True
MsgBox "Specified File Copied Successfully", vbInformation, "Done!"
Else
MsgBox "Specified File Already Exists In The Destination Folder", vbExclamation, "File Already Exists"
End If
End Sub
Có ai biết tại sao..chỉ em với...
Các anh cho em xin đoạn code đổi tên file sau khi coppy...
Chào thân ái....!!!