Windows Server Launching Putty from Excel

erling

New Member
Joined
Jan 20, 2016
Messages
1
Hi,

I have a Excel spreadsheet with hostnames in column A.
I have added this macro so that I can doubleclick to launch Putty to log on a given host with ssh:

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Range("A" & ActiveCell.Row) <> Empty Then
Shell "C:\Program Files (x86)\putty\putty.exe -agent @" & ActiveCell, vbNormalFocus
End If
End Sub

It works, but I have not been able to user pageant to avoid typing my password (I want to use key based auth).
Pageant works well if I start putty outside of Excel.
I have also tried to start pageant with a macro from Excel with no sucess.

Do you have any idea how I can fix this? I suspect it may be something with environment variables, etc if there is such a thing in Windows.

Thanks,

Erling
 

Solution
Yes Windows has environment variables they can be set with set <variable>=data and expanded with %variablename% You may want to try running the macro command from a command prompt and see if it generates an error. Also do you have all the keys imported into putty?

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,998
Yes Windows has environment variables they can be set with set <variable>=data and expanded with %variablename% You may want to try running the macro command from a command prompt and see if it generates an error. Also do you have all the keys imported into putty?
 

Solution
Back
Top