Launch external application

S

SP

I use excel to track information on a couple hundred switches and was
wondering if the following is possible.

Each row contains information on each switch including its IP address,
is it possible to launch an external application and pass the IP
address stored in the cell. The program I use is called putty and and
I can launch it from the command line with "putty 10.3.14.19".

Thanks
Sal
 
S

SP

I use excel to track information on a couple hundred switches and was
wondering if the following is possible.

Each row contains information on each switch including its IP address,
is it possible to launch an external application and pass the IP
address stored in the cell. The program I use is called putty and and
I can launch it from the command line with "putty 10.3.14.19".

Thanks
Sal

I have entered the following code and assigned it to an object:

Sub ActivateCalculator()
AppFile = "putty.exe"
On Error Resume Next
AppActivate "Putty"
If Err <> 0 Then
CalcTaskID = Shell(AppFile, vbNormalFocus)
If Err = 0 Then MsgBox "Unable to start the Calculator"
End If
End Sub

This works, when I click on the object the application starts.

I would like to pass the IP address stored in the cell to the
application.

Any suggestions.

Thanks
Sal
 
V

Vergel Adriano

Assuming the IP address is in A1, I believe this should work

CalcTaskID = Shell(AppFile & " " & Range("A1").Text, vbNormalFocus)
 
S

SP

Assuming the IP address is in A1, I believe this should work

CalcTaskID = Shell(AppFile & " " & Range("A1").Text, vbNormalFocus)


I edited the code so it pulls the data from the active cell.

Sub ActivatePutty()
Worksheets("Hosts").Activate
IP = ActiveCell.Value
AppFile = "putty.exe"
On Error Resume Next
AppActivate "putty"
If Err <> 0 Then
CalcTaskID = Shell(AppFile & " " & IP, vbNormalFocus)
If Err = 0 Then MsgBox "Unable to start the Calculator"
End If
End Sub

Thanks for the help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top