Wondering if anyone can give me some advice or a solution!
I'd like to invoke a script on my linux server using VBA in Excel. To do this, I'm using a local copy of Putty that's in the path.
I've successfully written a single command to create a putty session and log in to the server, I'm just unsure how to pass another command after this has been opened in the shell.
Any Ideas?
The below subroutine works, but causes a problem when the second command is attempted.
Thanks!
I'd like to invoke a script on my linux server using VBA in Excel. To do this, I'm using a local copy of Putty that's in the path.
I've successfully written a single command to create a putty session and log in to the server, I'm just unsure how to pass another command after this has been opened in the shell.
Any Ideas?
The below subroutine works, but causes a problem when the second command is attempted.
Code:
Sub test()
Dim putty As String
Dim strCommand As String
Dim strCommand1 As String
Dim User As String
Dim Pass As String
Dim Host As String
Dim File As String
Dim RemotePath As String
putty = """" & Range("E3").Text & "\Putty.exe"""
User = Range("E8").Text
Pass = Range("E9").Text
Host = Range("E7").Text
'File = """" & Range("E11").Text & """"
RemotePath = Range("E10").Text
strCommand = putty & " -l " & User & " -pw " & Pass & _
" " & File & " " & Host & ":" & RemotePath
strCommand1 = """" & Range("E3").Text & "\Putty.exe""" '"ls -l > shell.log"
'MsgBox strCommand
Shell strCommand, 1 ' vbNormalFocus '
Module2.WaitFor (5)
Shell strCommand1, 1
End Sub