Concurrency and VBA


Posted by Cathy Cullen on July 05, 2001 5:39 PM

I'm worried about concurrency in my excel vba
app. I'm using global variables to keep track
of counts.
For example. When a certain event happens, I
want excel to go get the next order number. I
then increment the next order number. How can
I avoid problems of more than one row getting
the same order number?

thanks



Posted by Malc on July 05, 2001 9:49 PM

Increment the global variable by one each time the event occurrs. Then select the next row down and unload the global variable there. You will need to enter an order number into the variable everytime Excel is started otherwise the variable will be empty. You could sort the order numbers into ascending order and go to the last row and get the highest order number and load the variable with that or write a bit of code to get the highest order number in the column using the Max function or something similar.