Hello!
I've had this issue crop up a few times now in the same project, and I can't make heads or tails of it.
The most recent time:
I have 5 comboBox shapes on a worksheet, and when 1 of the comboBoxes changes it resets the other 4.
Code looks something like this:
For some reason, If you do them in a specific order, Excel crashes pretty much instantaneously. (crashes if you click cbox 2,3 then 5; but it doesn't crash in any other order)
To try and figure it out, I tried Stepping through the code in break mode. I was surprised to find that my code ran just fine while in break mode.
Next, I ran the same code with a message box near the end of the code. What happened there was a bit strange. If I clicked through the message box right away, it crashed, but if I waited a few seconds before clicking "OK" then it ran without crashes...
Next up, I commented out different lines of code and found no errors. But now, when I uncommented everything and removed the messagebox line (basically reverting to the 'pre-debug' stage), everything is working, and it is not crashing anymore.
I seem to have fixed it, but I don't know what changed.... Any thoughts?
I've had this issue crop up a few times now in the same project, and I can't make heads or tails of it.
The most recent time:
I have 5 comboBox shapes on a worksheet, and when 1 of the comboBoxes changes it resets the other 4.
Code looks something like this:
Code:
ActiveSheet.Shapes("cBox1").OLEFormat.Object.value = 1
ActiveSheet.Shapes("cBox3").OLEFormat.Object.value = 1
ActiveSheet.Shapes("cBox4").OLEFormat.Object.value = 1
ActiveSheet.Shapes("cBox5").OLEFormat.Object.value = 1
For some reason, If you do them in a specific order, Excel crashes pretty much instantaneously. (crashes if you click cbox 2,3 then 5; but it doesn't crash in any other order)
To try and figure it out, I tried Stepping through the code in break mode. I was surprised to find that my code ran just fine while in break mode.
Next, I ran the same code with a message box near the end of the code. What happened there was a bit strange. If I clicked through the message box right away, it crashed, but if I waited a few seconds before clicking "OK" then it ran without crashes...
Next up, I commented out different lines of code and found no errors. But now, when I uncommented everything and removed the messagebox line (basically reverting to the 'pre-debug' stage), everything is working, and it is not crashing anymore.
I seem to have fixed it, but I don't know what changed.... Any thoughts?
Last edited: