Need to know how to keep a VB.exe from being open twice.
Printable View
Need to know how to keep a VB.exe from being open twice.
This should work:
Sub Main()
If App.PrevInstance then
End
End If
End Sub
If your project is set to start in Sub Main then the above will work without modification, but if your project is set to start in a form, then paste the if block at the very beginning of the Form_Load() procedure of the main form.
If you place that if statement as the first couple of lines of code that will be executed when the program starts up, it will ensure that if there is another version running, this one wont' start.
John
John Pirkey
MCSD
www.ShallowWaterSystems.com
Thanks for the help! I 'll give it a try.
Mike