Cancel action

  • Thread starter Thread starter an
  • Start date Start date
A

an

In command button I have:

Dim strMsg As String
Dim strInput As String
Dim strDir As String

strInput = InputBox(Prompt:=strMsg, ...)
strDir = "\...\...\"
Shell "C:\Program Files\...\... " & strDir & strInput,
vbMaximizedFocus

Where and what is possible to insert order for to cancel
operation without to execute the last line: Shell...

Thanks in advance
an
 
In command button I have:

Dim strMsg As String
Dim strInput As String
Dim strDir As String

strInput = InputBox(Prompt:=strMsg, ...)
strDir = "\...\...\"
Shell "C:\Program Files\...\... " & strDir & strInput,
vbMaximizedFocus

Where and what is possible to insert order for to cancel
operation without to execute the last line: Shell...

Thanks in advance
an

Use Exit.

strInput = InputBox(Prompt:=strMsg, ...)
strDir = "\...\...\"
If [some condition is met] Then
Exit [Sub or Function - whichever it is]
End if
Shell "C:\Program Files\...\... " & strDir & strInput,

- Jim
 
Thanks Jim.

For your reply and your solution.
Work fine!

an
-----Original Message-----
In command button I have:

Dim strMsg As String
Dim strInput As String
Dim strDir As String

strInput = InputBox(Prompt:=strMsg, ...)
strDir = "\...\...\"
Shell "C:\Program Files\...\... " & strDir & strInput,
vbMaximizedFocus

Where and what is possible to insert order for to cancel
operation without to execute the last line: Shell...

Thanks in advance
an

Use Exit.

strInput = InputBox(Prompt:=strMsg, ...)
strDir = "\...\...\"
If [some condition is met] Then
Exit [Sub or Function - whichever it is]
End if
Shell "C:\Program Files\...\... " & strDir & strInput,

- Jim
.
 
Back
Top