Code Execution Inexplicably Stops & Excel Soon Crashes

R

=Ray=

Excel 2007 on XP

I have two independent workbooks with a userform on each. One was originally
developed using Excel 2003, the other using 2007.

All of a sudden (since about a week ago or so), both of the userforms have
been giving me trouble. The old one (originally developed on 2003) has not
been modified, code-wise, but still behaves the same way.

What happens is that when the form is first shown, everything seems normal,
until a form button is clicked that executes sheet-modifying code (not
completely sure that's the right distinction, but I have a hunch it is). Then
it will execute a line or so of the code and abruptly stop execution and the
form disappears. Even when in break mode, when I press F8 to advance, the
same thing happens! Always on the same line, specific to the form.

If I reshow the userform (done via a worksheet button), it displays without
initialization, and the close box doesn't work (nor do the buttons, but
controls that enable/disable other controls do work!). If I do Alt-Esc or
click the stop button fromthe VBA editor, I can sometimes get out of it, but
if I try to reshow the form again, it says "Automation error: The object
invoked has disconnected from its clients" and proceeds to crash/restart
Excel.

Has anyone experienced anything like this before? Any solutions? The thing
that gets me is that it started happening all of a sudden, and is very
consistent, yet at least for one workbook, the code was unaltered!

Another strange thing that I was having problems with when I first started
creating the Excel 2007 userform, was that when I attempted to show it, it
would flash it, then hide immediately. Somehow I got past that, though. I'm
kind of frustrated with this.

Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top