BINOD SHARMA
New Member
- Joined
- Feb 12, 2020
- Messages
- 5
- Office Version
- 2007
My Friends, I have downloaded a vba code to send txt file from desktop to ftp server but I unable to understand why it"s not working ?
Can any one help
Sub IP_SERVER_IP()
Dim vPath As String
Dim vFile As String
Dim vFTPServ As String
Dim fNum As Long
vPath = ThisWorkbook.Path
vFile = "BKSSS.txt"
vFTPServ = "ftp://10.44.115.123"
'Mounting file command for ftp.exe
fNum = FreeFile()
Open vPath & "\BKSSS.txt" For Output As #fNum
Print #1, "user ***** *****" ' your login and password"
Print #1, "cd TargetDir" 'change to dir on server
Print #1, "put " & vPath & "\" & vFile & " " & vFile ' upload local filename to server file
Print #1, "close" ' close connection
Print #1, "quit" ' Quit ftp program
Close
Shell "ftp -n -i -g -s:" & vPath & "\BKSSS.txt " & vFTPServ, vbNormalNoFocus
SetAttr vPath & "\BKSSS.txt", vbNormal
Kill vPath & "\BKSSS.txt"
me.
code is -
Can any one help
Sub IP_SERVER_IP()
Dim vPath As String
Dim vFile As String
Dim vFTPServ As String
Dim fNum As Long
vPath = ThisWorkbook.Path
vFile = "BKSSS.txt"
vFTPServ = "ftp://10.44.115.123"
'Mounting file command for ftp.exe
fNum = FreeFile()
Open vPath & "\BKSSS.txt" For Output As #fNum
Print #1, "user ***** *****" ' your login and password"
Print #1, "cd TargetDir" 'change to dir on server
Print #1, "put " & vPath & "\" & vFile & " " & vFile ' upload local filename to server file
Print #1, "close" ' close connection
Print #1, "quit" ' Quit ftp program
Close
Shell "ftp -n -i -g -s:" & vPath & "\BKSSS.txt " & vFTPServ, vbNormalNoFocus
SetAttr vPath & "\BKSSS.txt", vbNormal
Kill vPath & "\BKSSS.txt"
me.
code is -