ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multi-threaded calculation and VBA (https://www.excelbanter.com/excel-programming/396335-multi-threaded-calculation-vba.html)

jorma

Multi-threaded calculation and VBA
 
I have an example with VBA and a simple sheet, which
- runs OK in Excel 2000
- runs OK in Excel 2007 when multi-threaded calculation is disabled
- fails in Excel 2007 when multi-threaded calculation is enabled on a
dual-core processor

It is really simple, it just changes some variables back and forth and
checks that the computed value from them is what it shoud be. There is a User
Form on the screen, and when I drag the form with my mouse during the
computation, the computation fails (in Excel 2007 on Vista with MTC and
dual-core).

The sheet is he
http://www.mylvin.com/stuff/mtctest.zip
Open the sheet, click the button "Start MTC Stress Test",
click the button "Start the test" on the form which opens,
and then drag the form to a different position on the screen with your mouse.
You'll see the error message about the computation.
If you don't drag, the test runs fine.

I'm not sure if this is a bug in Excel 2007 (if so, I don't know where to
report it) or a wrong approach when programming with VBA into multi-threaded
enviroment.

What do you think?

- Jorma.
http://www.mylvin.com


All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com