Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default thisworkbook.saveAs triggers change event?

I run to this problem today.
Whether or not I use VBA to save my workbook, it triggers a change event in
the first combobox in the code. Then it seems to reset the selection in some
other comboboxes.

Why is this happening and how can I prevent it?

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

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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default thisworkbook.saveAs triggers change event?

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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
BeforeUpdate Event triggers twice [email protected] Excel Programming 1 April 4th 06 09:10 AM
Event Triggers MVM Excel Programming 2 August 31st 05 03:29 PM
ThisWorkbook.SaveAs not saving correctly Ron[_28_] Excel Programming 2 December 23rd 04 12:29 PM
Click event on cell triggers a macro kris Excel Programming 2 November 13th 03 10:42 AM


All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"