Greetings all, long time viewer first time poster. Been teaching myself VBA for the last month.
I have a userform with some dropdowns that populate from a worksheet. When the user clicks Go, if the first dropdown matches a specific string ("Failed Attack") then a second userform is launched. When the user clicks Go on the second form, I want control to return to the sub in the first form. This was working for me yesterday, but I added some code (not much, nothing that I can remember that would cause the error) and now the following happens:
When the second userform is launched, and the user clicks OK on it, I get an Error 91 (Object variable or with block variable not set). Clicking debug highlights the show command for the second userform. This is confusing to me, because I assume that since the second userform is displayed, the code should go to the next line.
Below is the code for when you click Go on the first userform (called ufCloseWizard):
This is the code for when the user clicks Go on the second userform (ufFailedAttack):
All the Close* variables are publically defined in a regular module, and CLOSEMASTERWB and CLOSEMASTERWS are defined as public constants in a regular module.
This is the code when the second userform is loaded (in case its relevant):
Thanks in advance for any clues to this mystery! The data I'm working with is confidential so I cannot post the actual worksheets, but I'll be here for another 7 hours and am more than happy to try any suggestions.
Bookmarks