PDA

View Full Version : Solved: order of CALL statements



TrippyTom
02-10-2009, 06:36 PM
I found this quote:
Troubleshooting

Order of Execution. Visual Basic sometimes rearranges arithmetic expressions to increase internal efficiency. For that reason, if your argument list includes expressions that call other procedures, you cannot rely on them being called in any particular order.


from here...
http://msdn.microsoft.com/en-us/library/dz1z94ha.aspx

I am running into this exact problem. I have several Call statements within my main routine, and if I step through it line-by-line, the macro works perfectly, but if I just let it run all at once, it seems to be doing the steps out of order.

Is there any way around this?

Nelviticus
02-11-2009, 02:29 AM
That article only applies to VB, not VBA. In any case the bit you quoted specifically talks about the argument list, not the body of the function, so it sounds like a red herring as far as your problem is concerned.

Try putting Debug.Print statements before each Call so you can use the Immediate window to see what order they ran in.

TrippyTom
02-11-2009, 03:45 AM
Thanks, Nelviticus... you were right. It turns out my issue was due to something not related to the Call statements.