breynolds0431
Active Member
- Joined
- Feb 15, 2013
- Messages
- 303
- Office Version
- 365
- 2016
- Platform
- Windows
I have a userform (
Here is what I have in
So I tried adding an IF to
Any ideas on how to exit the whole operation with the
ufRandom
) that will show a disclaimer message, which is another userform titled ufDisclaimer
, after the user clicks a combo button to import a sheet from an external workbook. The import process uses the File Picker to allow the user to select the file they need imported. The ufDisclaimer
has two combo button options to Continue and Cancel. In the Cancel_Click()
, I have it first Unloading Me and then Unloading ufRandom
. Both userforms successfully unload, but the File Picker still subsequently displays.Here is what I have in
ufDisclaimer
:
VBA Code:
Private Sub cbCancel_Click()
Unload Me
Unload ufRandom
End Sub
So I tried adding an IF to
ufRandom
to exit if ufDisclaimer
's Cancel button was clicked. That didn't stop the File Picker from displaying either. Below is the piece from ufRandom
that is supposed to exit if the Cancel button was clicked.
Code:
Private Sub Import_Click()
'declarations here
ufDisclaimer.Show
If ufDisclaimer.cbCancel = True Then
Exit Sub
End If
'rest of code here
End Sub
Any ideas on how to exit the whole operation with the
ufDisclaimer
Cancel button?