I have a spreadsheet with one main userform that is shown by clicking a commandbutton in a worksheet. Occasionally, upon attempting to show the userform, Excel will provide the message indicating that it has encountered an error and needs to close, with no other error messages. I have also occasionally encountered an out of memory error that shows when the user attempts to close the workbook.
I'm trying to figure out if these two problems are related. I have some rather long macros, with the largest being about 116Kb, which resides in a module. The userform I am referring to has a .frx file of about 112Kb. Are either of these so large as to be causing these errors? I'm not worried about reducing macro sizes, but it's definitely more difficult to reduce the memory used by the userform.
The strangest thing is how sporadic this problem is. Upon encountering the fatal error that closes Excel (which just happens every so often for no apparent reason) , if I reopen, disable macros, rename the file, close and then reopen with macros enabled, it works fine. What about renaming the file is causing this error to go away? Thanks for your help!