Use app.prevInstance in the startup section of your app:
Code:
If App.PrevInstance Then ' insert your code to exit gracefully
All men have an inherent right to life, the right to self determination including freedom from forced or compulsory labour, a right to hold opinions and the freedom of expression, and the right to a fair trial and freedom from torture. Be aware that these rights are universal and inalienable (cannot be given, taken or otherwise transferred or removed) although you do risk losing the aforementioned rights should you fail to uphold them e.g Charles Taylor; United Nations sources: http://www.un.org/en/documents/udhr/, http://www.ohchr.org/EN/Professional...ages/CCPR.aspx. Also Charles I was beheaded on the 30th of January of 1649 for trying to replace parliamentary democracy with an absolute monarchy, the same should happen to Dr Phil and Stephen Fry; source: http://www.vbforums.com/showthread.p...ute-Monarchism.
That is definitely not the Application already active! msgbox you added, so you will need to step through your startup code to trace the error.
To step through your code:
1. Insert a stop point. Left click in the margin to the left of a line of code in your startup procedure. You will be able to see a red dot indicating a stop point is visible.
2. Then run your application. It will stop at the break point you just created.
3. Now step through your code a line at a time using the F8 button. Note you can use shift + F8 to skip over a call to a subroutine or a function.
Don't forget to remove the stop point when you have finished by left clicking the red dot you created in the margin.
All men have an inherent right to life, the right to self determination including freedom from forced or compulsory labour, a right to hold opinions and the freedom of expression, and the right to a fair trial and freedom from torture. Be aware that these rights are universal and inalienable (cannot be given, taken or otherwise transferred or removed) although you do risk losing the aforementioned rights should you fail to uphold them e.g Charles Taylor; United Nations sources: http://www.un.org/en/documents/udhr/, http://www.ohchr.org/EN/Professional...ages/CCPR.aspx. Also Charles I was beheaded on the 30th of January of 1649 for trying to replace parliamentary democracy with an absolute monarchy, the same should happen to Dr Phil and Stephen Fry; source: http://www.vbforums.com/showthread.p...ute-Monarchism.
That is definitely not the Application already active! msgbox you added, so you will need to step through your startup code to trace the error.
To step through your code:
1. Insert a stop point. Left click in the margin to the left of a line of code in your startup procedure. You will be able to see a red dot indicating a stop point is visible.
2. Then run your application. It will stop at the break point you just created.
3. Now step through your code a line at a time using the F8 button. Note you can use shift + F8 to skip over a call to a subroutine or a function.
Don't forget to remove the stop point when you have finished by left clicking the red dot you created in the margin.
Tks! But i have resolved with:
Code:
Private Sub Form_Load()
If App.PrevInstance Then
MsgBox "APPLICAZIONE *** " & App.Title & " *** GIA' IN ESECUZIONE!", vbInformation
End
End If
End Sub
All men have an inherent right to life, the right to self determination including freedom from forced or compulsory labour, a right to hold opinions and the freedom of expression, and the right to a fair trial and freedom from torture. Be aware that these rights are universal and inalienable (cannot be given, taken or otherwise transferred or removed) although you do risk losing the aforementioned rights should you fail to uphold them e.g Charles Taylor; United Nations sources: http://www.un.org/en/documents/udhr/, http://www.ohchr.org/EN/Professional...ages/CCPR.aspx. Also Charles I was beheaded on the 30th of January of 1649 for trying to replace parliamentary democracy with an absolute monarchy, the same should happen to Dr Phil and Stephen Fry; source: http://www.vbforums.com/showthread.p...ute-Monarchism.