RobBroekhuis
Technical User
Hi all,
A ran across a strange thing today. I was troubleshooting some code, and it kept hanging up excel - completely, no recovery possible. Finally, I traced the problem to the innocuous-looking code:
rows=rows+1
The "rows" variable had not been declared, and I always work in "option explicit", so it was odd that Excel hadn't flagged it as a problem upon compiling. Anyway, I changed the variable name to nrows and declared it properly, and the problem went away.
However, I'm still curious what was going on. When I start up Excel, go into the VBA editor's immediate window, and type
?rows
Excel hangs completely. It does the same when I type
?columns
Other previously undeclared variables don't have the same problem.
Any ideas what's going on?
Rob
A ran across a strange thing today. I was troubleshooting some code, and it kept hanging up excel - completely, no recovery possible. Finally, I traced the problem to the innocuous-looking code:
rows=rows+1
The "rows" variable had not been declared, and I always work in "option explicit", so it was odd that Excel hadn't flagged it as a problem upon compiling. Anyway, I changed the variable name to nrows and declared it properly, and the problem went away.
However, I'm still curious what was going on. When I start up Excel, go into the VBA editor's immediate window, and type
?rows
Excel hangs completely. It does the same when I type
?columns
Other previously undeclared variables don't have the same problem.
Any ideas what's going on?
Rob