Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Alan
 
Posts: n/a
Default Some macro help with shelling out to other program

We are using VNC in house to do remote control between workstations.
As there are over 25 of them, I would like to set up a little macro in
Excel (2003) that when run, displays a list of user names along with a
box prompting for which # on the list you want to connect to.

Here's what I have so far:
----
Sub RunVNC()

Shell ("c:\program files\hyena\vncviewer.exe sv-ws6")

End Sub
----
I would like to see something like:
1. Payroll
2. Receivables
3. Accountant
4. Reception
Please enter the number to connect to:

Typing 1 and pressing ENTER would run the Shell command above.

Can anyone help??

TIA, Alan
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

When your list gets a little longer, you may want to consider creating your own
userform.

But with just 4, this seems to work ok for me:

Option Explicit
Sub RunVNC()
MsgBox 1
'Shell ("c:\program files\hyena\vncviewer.exe sv-ws6")
End Sub
Sub Run2()
MsgBox 2
End Sub
Sub Run3()
MsgBox 3
End Sub
Sub Run4()
MsgBox 4
End Sub
Sub Menu()
Dim resp As Variant
Dim maxOptions As Long

maxOptions = 4

resp = Application.InputBox _
(Prompt:="1. Payroll" & vbLf & _
"2. Receivables" & vbLf & _
"3. Accountant" & vbLf & _
"4. Reception" & vbLf & _
vbLf & "Please type a number and hit enter", Type:=1)

If resp = False Then
Exit Sub
End If

If CLng(resp) < 1 _
Or CLng(resp) maxOptions Then
MsgBox "Come back later!"
Exit Sub
End If

Select Case CLng(resp)
Case Is = 1: Call RunVNC
Case Is = 2: Call Run2
Case Is = 3: Call Run3
Case Is = 4: Call Run4
End Select

End Sub


Alan wrote:

We are using VNC in house to do remote control between workstations.
As there are over 25 of them, I would like to set up a little macro in
Excel (2003) that when run, displays a list of user names along with a
box prompting for which # on the list you want to connect to.

Here's what I have so far:
----
Sub RunVNC()

Shell ("c:\program files\hyena\vncviewer.exe sv-ws6")

End Sub
----
I would like to see something like:
1. Payroll
2. Receivables
3. Accountant
4. Reception
Please enter the number to connect to:

Typing 1 and pressing ENTER would run the Shell command above.

Can anyone help??

TIA, Alan


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
How to program an excel macro to repeat a series of keystrokes? Beancounter Excel Discussion (Misc queries) 8 January 22nd 05 11:51 PM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 07:37 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"