View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Neal Zimm Neal Zimm is offline
external usenet poster
 
Posts: 345
Default NOT static variable problem

In a module with some 40 procedures I have dim'd a lot of variables
in the declarations section. I am developing this application on a home PC.
It will execute in a networked environment.

NONE of the vars are static. ajcdone is dim'd as string.

in sub "A" I have: ajcdone="y" based on processing status

in sub "B", called in the same 'overall' macro as A above I have:
if ajcjdone < "y" then.....

In my testing I executed sub A. It ended with ajcdone = to "y" BUT,
sub B was not executed due to other logic, and the 'overall' macro was
exited.

I diddled with the worksheets involved for a couple of minutes and then
independantly executed sub B, NOT expecting ajcdone to have any value,
but be null. Well, surprise surprise.

ajcdone WAS = to "y". How come?
Is this just bad luck with a memory location? or am I doing something wrong?

I suppose I can stick a value in a cell in one of the involved worksheets
and test it, but would rather not.

Thanks for you help.
Neal



--
Neal Z