I am a little confused I have a series of user forms and I wanted to hide the excel application when the file is loaded, then the only thing that is displayed is the user form. Well hiding the application and all my user forms works great with the exception of a couple of command buttons.
I am trying to provide the user an exit from the user forms.
The problem is if I use application.quit it will exit the workbook and appear as if excel closed. However if you look in task manager under processes you will see that excel is still running in the background.
What I am confused about is why application.quit will not exit the application.
What can I do to correct this issue?
I have enclosed the code for both command buttons.
Thanks in advance for any help.
TO EXIT COMPLETELY I AM USING THIS
COMMAND BUTTON CODE USED..
---------------------------------------
Private Sub CommandButton2_Click()
page1.Hide
Application.DisplayAlerts = False
ActiveWorkbook.Close , SAVECHANGES = False
Application.Quit
End Sub
-------------------------------------------
To cancel I am using this code.
------------------------------------------------
Application.DisplayAlerts = False 'Turn off before saving
Range("A1").Select
VARANSWER = MsgBox("ARE YOU SURE YOU WANT TO CLOSE ? ", vbYesNo + vbCritical, "TEST")
If VARANSWER = vbNo Then Exit Sub
question1.Hide
ActiveWorkbook.Close , SAVECHANGES = False
Application.Quit
------------------------------------------
Bookmarks