Excel VBA seems to read an old value from a cell
-
I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.
-
I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.
With the amount of people that have been using Excel, it is very unlikely that there's a bug that's that basic. Also, the computer doesn't do stuff "randomly"; that's simply our way of describing stuff when we can't see the pattern. Is there timing involved in your code? Can you reproduce the error?
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.
Male sure you are reading the same value IE CurrentValue, excel has the ability to roll back changes and you may be reading from the wrong/different property.
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
-
I have a weird situation where (randomly) a previous Cell value is read by the Excel VBA code. eg: Cell 1A had a value = Y. It was updated to N. However a subsequent VBA code read the cell value as Y It has been hard to troubleshoot as this was a random occurrence. I was lucky to catch one today, and upon stepping through the code (using F8) discovered that the correct current value was read during debug!. Re-run the macro without debug mode and the correct value was read. Its very confusing and I cannot think of anything but an Excel bug. Have you encountered this issue at all and if so what solution/s have you applied. Thanks in advance.