Hi All,
Kindly help me in the below code. It is running but only when am swtiching between excel and putty server manully.
Sub Putty()
Dim TaskID As Long
Windows("auto.xlsb").Activate
Sheets("Sheet1").Select
Range("h15").Select
TaskID = Shell("C:\Program Files (x86)\Quest Software\PuTTY\PuTTY.exe duk2srv0256 -pw password", vbMaximizedFocus)
AppActivate TaskID, True
SendKeys "{ENTER}", True
SendKeys "{ENTER}", True
wait
wait
SendKeys "sh /cm/dev/saswork/Inder/CV_Daily_Check/inder.sh"
SendKeys "{ENTER}", True
MsgBox "process completed"
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Public Sub wait()
Dim sttime, curtime
Dim tt As Integer
sttime = Timer
tt = 0
While tt < 1
curtime = Timer
tt = curtime - sttime
Wend
End Sub
Kindly help me in the below code. It is running but only when am swtiching between excel and putty server manully.
Sub Putty()
Dim TaskID As Long
Windows("auto.xlsb").Activate
Sheets("Sheet1").Select
Range("h15").Select
TaskID = Shell("C:\Program Files (x86)\Quest Software\PuTTY\PuTTY.exe duk2srv0256 -pw password", vbMaximizedFocus)
AppActivate TaskID, True
SendKeys "{ENTER}", True
SendKeys "{ENTER}", True
wait
wait
SendKeys "sh /cm/dev/saswork/Inder/CV_Daily_Check/inder.sh"
SendKeys "{ENTER}", True
MsgBox "process completed"
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Public Sub wait()
Dim sttime, curtime
Dim tt As Integer
sttime = Timer
tt = 0
While tt < 1
curtime = Timer
tt = curtime - sttime
Wend
End Sub