Hello
i used this code to copy a file to the SFTP no error displayed when i running the macro but the file is not copied
Sub FTPUpload
Set oShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Path to file or folder to upload
path = "C:\Users\Documents\AJOUUUTTTTT.TXT"
On Error Resume Next
Const copyType = 16
'FTP Wait Time in ms
waitTime = 80000
'Configuración FTP
FTPUser = "**************"
FTPPass = "**************"
FTPHost = "172.28.70.151"
FTPDir = "**************"
strFTP = "ftp://" & FTPUser & ":" & FTPPass & "@" & FTPHost & FTPDir
Set objFTP = oShell.NameSpace(strFTP)
'Upload single file
If objFSO.FileExists(path) Then
MSGBOX 'test'
Set objFile = objFSO.getFile(path)
strParent = objFile.ParentFolder
Set objFolder = oShell.NameSpace(strParent)
Set objItem = objFolder.ParseName(objFile.Name)
objFTP.CopyHere objItem, copyType
End If
WScript.Sleep waitTime
End Sub