Ich habe eine Userform mit Schaltflächen. Wie kann ich über die Schaltflächen jetzt ein Programm (FTP, Browser) aufrufen, und wenn möglich gleich die passenden Daten übergeben. Also gleich die FTP-Login-Daten.
Private Sub FTP_Click()
Dim lng As Integer
Dim User As String
Dim Password As String
Dim Server As String
Sheets("DATEN").Activate
lng = UserForm3.ListBox1.Column(5)
With UserForm3
TextBox1.Value = Cells(lng, 1).Value
TextBox2.Value = Cells(lng, 2).Value
TextBox3.Value = Cells(lng, 3).Value
TextBox4.Value = Cells(lng, 4).Value
TextBox5.Value = Cells(lng, 5).Value
TextBox6.Value = Cells(lng, 6).Value
TextBox7.Value = Cells(lng, 7).Value
TextBox8.Value = Cells(lng, 8).Value
TextBox9.Value = Cells(lng, 9).Value
TextBox10.Value = Cells(lng, 10).Value
TextBox11.Value = Cells(lng, 11).Value
TextBox12.Value = Cells(lng, 12).Value
TextBox13.Value = Cells(lng, 13).Value
TextBox14.Value = Cells(lng, 14).Value
TextBox15.Value = Cells(lng, 15).Value
Server = Cells(lng, 3).Value
User = Cells(lng, 4).Value
Password = Cells(lng, 5).Value
Call Shell("C:\Portable Programme\WinSCPPortable\WinSCPPortable.exe open user:password@server", _
1)
End With
End Sub
Ich kann WINSCP starten, kriege dann aber die Meldung "Host does not exist". Selbst, wenn ich die Daten fest eintrage, um die Funktion zu testen.
Dim User As String
Dim Password As String
Dim Server As String
Dim Connect As String
Connect = "C:\Portable Programme\WinSCPPortable\App\winscp\WinSCP.Exe" & " " & "ftp://" & User & _
":" & Password & "@" & Server
Shell Connect
Warum Connect als Variable? Mit Shell und dem String hinter Connect erhielt ich immer Fehlermeldungen.