"Out of Context" Message?

M

Mac Lingo

When I execute the following line of VB Macro code
ActiveSheet.Cells(2,1) = "Hi"

the computer seems to stop processing and all the variables I am watching in
the
"Watches" Screen have their Value change to "<Out of Context>.

Anyone know what's going on? I'm kind of at my wit's end trying to figure
this one out. "Out of context" is not even defined in their help file or
Knowledge Base.

Thanks,
Capt Mac
 
M

Mac Lingo

Missing Information from the Problem - The VB Macro is calle as a FUNCTION
being
called from the spreadsheet.

The Solution: - A Rule: You CAN'T change the enviornment a Function is being
called from. I suppose this is because it too easily can end up in an
infinite loop, but for whatever reason EXCEL won't allow it.

Answer: You have to write a SUBROUTINE instead.
 
Top