Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell Function Syntax Error

Status
Not open for further replies.

Taktar

Programmer
Jul 6, 2003
2
0
0
US
hey i was wondering if you guys could help me out
i'm a relatively new programmer and i'm having some trouble with my syntax:
[/b]
Private Sub mnuOpen_Click(Index As Integer)
Dim dstranswer As String
strAnswer = InputBox("Enter the Path of the File:")
Shell ("&stranswer&")
End Sub

i was wondering if you guys could look at this and tell me waht i've done wrong

Thanks,
Taktar

 
Because you have a string in quotes, it is being interpreted as a literal. "&stranswer&" is treated as the literal string &stranswer&. Outside of quotes, then the & become the string concatenation operator, and strAnswer would be resolved as a variable.

if strAnswer s the full pathname to an executable file, then you should be able to do the following:

Shell strAnswer, vbNormalFocus



Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top