R
RockyDuck
At work there has been a situation where a few people have complained that
they have saved a workbook and their changes have been lost without warning.
A member of the systems team wrote a Macro that Opens a workbook in write
mode (and if the open fails keeps looping until it has successfully opened
the work book), adds 1 to cell A1 in a sheet (which starts at 0), and closes
the workbook saving the changes. It performs these actions 20 times.
If this macro is run on a single machine then, if you open the workbook, you
will find cell A1 contains the value 20. If you reset the counter to zero and
run the macro on two separate machines at different times then the counter in
the workbook is 40. The fun starts where the macro is run on two machines at
the same time after resetting the counter to 0. When the macros have finished
running the value in Cell A1 might for instance be 34. Clearly some of the
updates to the workbook are being lost without warning.
It is as if sometimes two users could open the same workbook for write
access and both be granted this access. The first user that saves their
changes loses them because the second user overwrites them.
Has anybody ever had a similar problem which they have managed to solve.
Thanks.
they have saved a workbook and their changes have been lost without warning.
A member of the systems team wrote a Macro that Opens a workbook in write
mode (and if the open fails keeps looping until it has successfully opened
the work book), adds 1 to cell A1 in a sheet (which starts at 0), and closes
the workbook saving the changes. It performs these actions 20 times.
If this macro is run on a single machine then, if you open the workbook, you
will find cell A1 contains the value 20. If you reset the counter to zero and
run the macro on two separate machines at different times then the counter in
the workbook is 40. The fun starts where the macro is run on two machines at
the same time after resetting the counter to 0. When the macros have finished
running the value in Cell A1 might for instance be 34. Clearly some of the
updates to the workbook are being lost without warning.
It is as if sometimes two users could open the same workbook for write
access and both be granted this access. The first user that saves their
changes loses them because the second user overwrites them.
Has anybody ever had a similar problem which they have managed to solve.
Thanks.