Excel 97 - Application.Iteration is always FALSE?
Getting snappy? umf?
Yes, sorry about that. Aside from a character flaw, I was in a harsh
battle with Excel as well. Apologies.
THIS UDF:
Function Iter_Status()
If Application.Iteration Then
Iter_Status = "TRUE"
End If
End Function
Since it's return value is UNtyped, it cannot return a
False boolean value even if it wanted too.
it MAY return an Empty Variant or a string with "TRUE"
I cant reproduce the anomaly you describe.(xl97 and xlXP)
and I'm still wondering what your real UDF's code looks like.
True. It was as provided when I wrote it. Alse typed it as boolean at
some stage etc. Never got TRUE or "TRUE".
What does your immediate screen show when you run my example code?
Still need to try that one. I tried the one suggested by Charels, and
indeed it prints FALSE 4 times before it switches to True. I'll try
yours as well
Oh well, tried it right now. When called from the subroutine, it
returns TRUE aftr it is set to true. This is not the case when called
from the worksheet. Here it gets strange.
If I switch iteration on via Tools Options and I call it from the
worksheet, the output is:
called from worksheet!
INSIDE FUNCTION SET TRUEFalse
INSIDE FUNCTION SET FALSEFalse
AND: Tools Options show Iterations is STILL on....
Switching it off in Tools Options shows same output and Tools Options
afterwards shows it to be off (which I would expect in any case).
Are you saying that when you call IterFunc from the worksheet, it
prints:
called from worksheet!
INSIDE FUNCTION SET TRUETrue <- The difference
INSIDE FUNCTION SET FALSEFalse?
Thanks for your time.
|