Anscheinend is hier noch ein kniffliger Fehler versteckt
https://www.herber.de/cgi-bin/callsmpl.pl?Datei=157501h.htm
'StandardModule: basMain
Sub DownIndexXLS()
Close
Open "c:\LogIn.txt" For Output As #1
Print #1, "Benutzername"
Print #1, "Passwort"
Print #1, "cd www"
Print #1, "cd forum"
Print #1, "binary"
Print #1, "get index.xls c:\test\test.xls"
Print #1, "quit"
Close
Call Win32WaitTilFinished("ftp -s:c:\login.txt ftp.herber.de")
Workbooks.Open "C:\test\test.xls"
End Sub
Sub UpIndexXLS()
Dim strDate As String
Open "c:\LogIn.txt" For Output As #1
Print #1, "Benutzername"
Print #1, "Passwort"
Print #1, "cd www"
Print #1, "cd forum"
Print #1, "binary"
Print #1, "put c:\test\test.xls"
Print #1, "quit"
Close
Call Win32WaitTilFinished("ftp -s:c:\login.txt ftp.herber.de")
MsgBox "Daten wurden hochgeladen!"
End Sub
'StandardModule: basFunctions
Public Const PROCESS_QUERY_INFORMATION = &H400
Public Const WAIT_TIMEOUT = &H102&
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) As Long
Sub Win32WaitTilFinished(ProgEXE As String)
Dim ProcessID As Long
Dim hProcess As Long
Dim RetVal As Long
ProcessID = Shell(ProgEXE, vbHide)
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessID)
Do
DoEvents
RetVal = WaitForSingleObject(hProcess, 50)
Loop Until RetVal <> WAIT_TIMEOUT
End Sub