View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alerion Alerion is offline
external usenet poster
 
Posts: 11
Default thisworkbook.saveAs triggers change event?

No problem. I have no knowledge why some events are fired spontaneously. The
same problem is actually now discussed in another thread. You can find it
with the subject "fires events without reason".

Alerion


"Rick Humphrey" kirjoitti:

Thanks,

Wish I looked here first, better yet wish I thought of the jumper to
use.... It is always gratifying to find someone else who is struggling with
the same thing I've been banging my head against.... Why does Excel think I
changed the selected item in my combo box when I am closing the workbook?

Rick

"Alerion" wrote:

Figured this one out myself, sort of. As excel really shouldn't raise a
change event in my comboboxes when I try to save my workbook, and I couldn't
find a way to prevent it, I found a way to evade the problem. "Using
application.enableEvents = false" didn't help at all.

The solution was to declare a variable of boolean type and set it true as
the saving begins. (remember to set if false as it finishes.) To every change
event I wrote if thisboolean is false then execute the code. Ie. if not, skip
the unwanted event.

Hope this helps others as this seems to be a bug in excel.