Hi Everyone
I have created a userform for a financial model that contains a disclaimer. Whilst the userform (disclaimer) is active the excel workbook is not visible.
At the bottom of the userform you can either accept the terms and conditions or not accept.
When selecting not accept the intent is that the disclaimer will disappear and the workbook will not appear or be visible and close down in the background. When you click accept a new userform appears to enter a password.
When the do not accept button is clicked the disclaimer disappears and the workbook does not appear or become visible as expected however, when I click on the workbook to try and open it again the work book opens automatically without the disclaimer showing.
The VBA code I have written for the "do not accept" command button is as follows:
Private Sub CommandButton1_Click()
Unload Me
ActiveWorkbook.Close True
Application.Quit
End Sub
-------------------------------------------------
Private Sub CommandButton2_Click()
UserForm2.Show
End Sub
----------------------------------------
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Unload Me
ActiveWorkbook.Close True
Application.Quit
End Sub
Can anyone advise what I have wrong in my code? It would appear that when the button is clicked it is not showing the workbook but it is opening somehow in the background so that when I click to open the workbook again it is not launching the disclaimer. Any help would be appreciated.
Regards
Doug
I have created a userform for a financial model that contains a disclaimer. Whilst the userform (disclaimer) is active the excel workbook is not visible.
At the bottom of the userform you can either accept the terms and conditions or not accept.
When selecting not accept the intent is that the disclaimer will disappear and the workbook will not appear or be visible and close down in the background. When you click accept a new userform appears to enter a password.
When the do not accept button is clicked the disclaimer disappears and the workbook does not appear or become visible as expected however, when I click on the workbook to try and open it again the work book opens automatically without the disclaimer showing.
The VBA code I have written for the "do not accept" command button is as follows:
Private Sub CommandButton1_Click()
Unload Me
ActiveWorkbook.Close True
Application.Quit
End Sub
-------------------------------------------------
Private Sub CommandButton2_Click()
UserForm2.Show
End Sub
----------------------------------------
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Unload Me
ActiveWorkbook.Close True
Application.Quit
End Sub
Can anyone advise what I have wrong in my code? It would appear that when the button is clicked it is not showing the workbook but it is opening somehow in the background so that when I click to open the workbook again it is not launching the disclaimer. Any help would be appreciated.
Regards
Doug