"Microsoft Excel has encountered a problem..."

K

Ken Dahlberg

There is a point where my VBA(Excel XP) code stops executing with the
message "Microsoft Excel has encountered a problem and needs to close.
We are sorry for the inconvenience." (Aw! How compassionate!) It
happens while initializing an instance of a class called DVrnt, which
implements another class called DataField:

CODE FROM DVrnt CLASS MODULE:
----------------------------
Option Explicit
Option Base 1
Implements DataField
private df as DataField
..
..
..
' Initialize the implemented DataField
Private Sub Class_Initialize()
Set df = New DataField <==== EXCEL DIES HERE
End Sub

The initialization sub for the DataField class doesn't do anything,
and doesn't need to:

CODE FROM DataField CLASS MODULE:
--------------------------------
Private Sub Class_Initialize()
End Sub

Yesterday I debugged the whole project that contains this code and it
all worked. Then, with no further changes, this behavior started.

What can cause this kind of crash, and how is a person supposed to
debug it???? Thanks for any tips. (I went through Microsoft's error
reporting thing and followed their links hoping for help, but this was
unproductive).

Ken Dahlberg
 
K

Ken Dahlberg

A testimonial: since posting this, I downloaded and ran Rob Bovey's
CodeCleaner. It reduced the xls file size by 85 kb and *seems* to
have cured the crash problem...KD
 

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