Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
BeforeUpdate Event triggers twice | Excel Programming | |||
Event Triggers | Excel Programming | |||
ThisWorkbook.SaveAs not saving correctly | Excel Programming | |||
Click event on cell triggers a macro | Excel Programming |