0
여기에서 몇 가지 코드로 나를 도울 수 있기를 바랍니다. ftp 명령 파일을 만든 다음 배치 파일을 실행하는 모듈을 만들었습니다. Excel vba ftp가 성공했지만 서버에 문서가 없습니까?
나는 다른 StackOverflow의 게시물에서이 프로세스를 가지고 : FTP a text file to a server using VBA in Excel시간 TEST.TXT 중 일부는 대부분의 시간을 그렇지, 서버에 표시됩니다. 그러나 ftp 프롬프트는 항상 성공적인 전송을보고합니다.
Private Sub SendFileToServer()
Dim sCmdFile As String
Dim sBatFile As String
Dim vPath As String
Dim iFileNum As Integer
vPath = ThisWorkbook.Path
sCmdFile = vPath & "\" & "ftp" & "\" & "ftpCommand.txt"
iFileNum = FreeFile
Open sCmdFile For Output As iFileNum
Print #iFileNum, "open 555.555.555.55"
Print #iFileNum, "user username"
Print #iFileNum, "password"
Print #iFileNum, "hash"
Print #iFileNum, "ascii"
Print #iFileNum, "lcd " & vPath
Print #iFileNum, "cd dsi_Timesheets"
Print #iFileNum, "put " & vPath & "\" & "test.txt"
Print #1, "close"
Print #1, "quit"
Close #iFileNum
Shell "ftp -n -i -g -s:" & vPath & "\ftp" & "\ftpCommand.txt " & vFTPServ, vbNormalNoFocus
SetAttr vPath & "\ftp" & "\ftpCommand.txt", vbNormal
Kill vPath & "\ftp" & "\ftpCommand.txt"
End Sub
감사