P
PatFinegan
I have a public date variable that's retrieved from a worksheet cell and
"rounded" to the last day of the month in which it resides. This takes
just one small line of code. There are no other manipulations of the
variable, although it is referenced frequently without incident in
multiple procedures spanning thousands of lines of code.
The expression somehow causes an error 16 ("expression too complex")
when I compare that variable to another date variable in just one
procedure. Strangely, the expression is OK if, after receiving the
error, I click Debug and then Continue. But if I add a breakpoint where
the code crashes, I see that the variable is indeed flagged "expression
too complex", and I have to put an Error/Resume routine in in order to
get past this point automatically.
I can of course insert such an Error/Resume handler or re-populate the
variable from the worksheet, but I'd like to know why I'm encountering
a problem in the first place. Any thoughts? Thanks in advance.
"rounded" to the last day of the month in which it resides. This takes
just one small line of code. There are no other manipulations of the
variable, although it is referenced frequently without incident in
multiple procedures spanning thousands of lines of code.
The expression somehow causes an error 16 ("expression too complex")
when I compare that variable to another date variable in just one
procedure. Strangely, the expression is OK if, after receiving the
error, I click Debug and then Continue. But if I add a breakpoint where
the code crashes, I see that the variable is indeed flagged "expression
too complex", and I have to put an Error/Resume routine in in order to
get past this point automatically.
I can of course insert such an Error/Resume handler or re-populate the
variable from the worksheet, but I'd like to know why I'm encountering
a problem in the first place. Any thoughts? Thanks in advance.