PDA

View Full Version : [SOLVED] Switch between Putty and Xshell using same Loginbutton



ganesh_6663
04-03-2019, 06:29 AM
Hi team,
I created userform vba to login in to 2 server using putty with one loginbutton ,


Sub puttyserver1

pcmd = D:putty serverip -l demo -pw pass
'
End Sub


Sub puttyserver2
'
pcmd = D:putty serverip -l demo -pw pass
'
End Sub


---------------------------------------------------------------------------------------------------------------------------


I want to login to same server but with Xshell with same loginbutton using combobox (to select between Putty and Xshell)
or anything else which can work with userform vba.
Need to call Sub puttyserver1/Xshellserver1 depending upon combobox selection with same loginbutton.


Sub Xshellserver1
'
'
pcmd = Xshell -newwin ssh
'
'
End Sub


Sub Xshellserver2
'
pcmd = Xshell -newwin ssh
'
End Sub






Any help appreciated :):):):):)

大灰狼1976
04-03-2019, 06:47 AM
Hi ganesh!
Welcome to vbax forum.
Maybe "Application.Run" can fulfill your requirements.

ganesh_6663
04-03-2019, 10:08 AM
Hi ganesh!
Welcome to vbax forum.
Maybe "Application.Run" can fulfill your requirements.

Thanks for reply , but can u explain how can i use "Application.Run" please with an example

大灰狼1976
04-03-2019, 04:34 PM
I will post a simple example later.

大灰狼1976
04-03-2019, 09:24 PM
Just a simple example.

ganesh_6663
04-03-2019, 10:20 PM
Just a simple example.

Thank you so much its really work for me. .
but his macro problem is , don't need "server no" ComboBox , instead of that need command button.



Image and file attached for ur reference .
https://pasteboard.co/I8wNZ1T.jpg

大灰狼1976
04-04-2019, 12:12 AM
Please refer to the attachment.

ganesh_6663
04-04-2019, 12:33 AM
Please refer to the attachment.


Wow your legend, its works!!!!:bow::clap:
Thank you sooooo much for your help and time given for me :)

大灰狼1976
04-04-2019, 12:41 AM
You're welcome:friends:

Rob342
04-04-2019, 12:57 AM
crossposted https://www.excelforum.com/excel-programming-vba-macros/1271063-switch-between-putty-and-xshell-using-same-loginbutton.html
Please read rules on cross posting

ganesh_6663
04-04-2019, 01:02 AM
crossposted https://www.excelforum.com/excel-programming-vba-macros/1271063-switch-between-putty-and-xshell-using-same-loginbutton.html
Please read rules on cross posting


Yes , i will take care this next time.
mark as solved on excelforum.