Hi,
I'm trying to see if I can launch a bit of code (program directory) from a textbox.
I'm looking to do this so that the user can chose the location of a directory of a program on there pc and type it into a text box so then when my program runs they can launch it directly from the program but due to the nature of some programs being in different locations I want to the user to be able to define where it is.
Currently it works like this:
The code checks to see if calculator is open and if it is brings it to the front and it it doesn't launch's it:
I want for it to do something like this with the directory in textbox1, but obviously this doesn't work.
If (Err.Number <> 0) Then Shell("textbox1.text)
Any Ideas or point in right direction??
Thanks
I'm trying to see if I can launch a bit of code (program directory) from a textbox.
I'm looking to do this so that the user can chose the location of a directory of a program on there pc and type it into a text box so then when my program runs they can launch it directly from the program but due to the nature of some programs being in different locations I want to the user to be able to define where it is.
Currently it works like this:
Code:
#If True Then
Private Sub CalculatorToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles CalculatorToolStripMenuItem1.Click
On Error Resume Next
AppActivate("Calculator")
If (Err.Number <> 0) Then Shell("calc.exe")
End Sub
#End If
Code:
If (Err.Number <> 0) Then Shell("calc.exe")
If (Err.Number <> 0) Then Shell("textbox1.text)
Any Ideas or point in right direction??
Thanks