MOvais_Khan
asked on
Multiple Instances of an application
Dear Experts,
How can we prevent a VB program from running multiple instance of it. As some users intentionally try to open multiple instance the program.
Rgds/Shihab
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
GIVE ME NO POINTS FOR THIS---------------------- --
because JigglyD wrote the same code (almost)
If u want just to unload the new instance, with no messages, etc, just write:
If app.previnstance then end
inside the Sub Main()
because JigglyD wrote the same code (almost)
If u want just to unload the new instance, with no messages, etc, just write:
If app.previnstance then end
inside the Sub Main()
Sub Main()
If App.PrevInstance Then
MsgBox "An instance of this program is already running...", vbInformation, ""
Unload Me
Else
frmMain.Show '*** Assuming that frmMain is your current Startup form
End If
End Sub
Jiggle On ! ! !