Hello
I have a really weird error and I have no idea what's causing it. In my project there is a very big userform with several tabs that is loaded using a subroutine. Sometimes when the sub is run it results in the error "Microsoft excel has encountered a problem and needs to close" with no further information as to what is causing it. The issue is complicated further by the fact that every time I attempt to add breaks to the code the error does not occur which makes it difficult to pinpoint the problem. If the error does not occur the first time the sub is run it will run smoothly all other runs as well until Excel is restarted, then it (sometimes) start happening again. If I open the project and do something like generate a report before I run the sub it works fine. Furthermore if I add msgboxes scattered across the code to track how far it gets (since breaks make the error go away) the error does not occur.
I don't know exactly when the error started occuring either since it doesn't occur until I restart Excel.
I wish I could give you code to look at but the the sub is HUGE and I have no idea what part of it is causing the error. The code is mostly database queries, comparisons and updates to form controls. An example code snippet (which could cause it for all I know) is here:
Has anyone else encountered this problem? How did you solve it? Any suggestions as to how to pinpoint the error?Please Login or Register to view this content.
Bookmarks