Hi Guys!Good day!

Ive notice just this day that the user of the program Ive made can double execute the program. I want the program to behave that when the process(task manager) of the program is already running, and when the user run the program again, the msgbox will show that "cannot run program because it is already running". I really dont know how to start the coding. Pls help.

Anybody has already made this program pls help me.

Thank you and God bless on this mother Earth.

Option Explicit

Private Sub Form_Load()
   If App.PrevInstance = True Then
      MsgBox "Program already running.", vbInformation, "Program status"
   ' End the program
   End
  
   End If
End Sub
Comments
has the expertise
Option Explicit

Private Sub Form_Load()
   If App.PrevInstance = True Then
      MsgBox "Program already running.", vbInformation, "Program status"
   ' End the program
   End
  
   End If
End Sub

Thank you guys. This problem was solved.

This question has already been answered. Start a new discussion instead.