Johnny C
Well-known Member
- Joined
- Nov 7, 2006
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
I'm using the following piece of code to toggle between a single processor doing a long calculation on a dual core PC and both processors doing it. The reason is that the calculations can be 10-20mins and I can do other things if I switch to 1 (i.e. surf the web or work on Access)
However it doesn't like the automatic setting (xlThreadModeAutomatic = 0). It works fine if I set the threadcount to 2, but I'd like it to be automatically scaleable for more processors.
According to Xl2007 Help it should work fine, any ideas?
Code:
application.GenerateTableRefs = xlGenerateTableRefStruct
If application.MultiThreadedCalculation.ThreadCount = 1 Then
application.MultiThreadedCalculation.ThreadCount = xlThreadModeAutomatic
Else
application.MultiThreadedCalculation.ThreadMode = 1
End If
However it doesn't like the automatic setting (xlThreadModeAutomatic = 0). It works fine if I set the threadcount to 2, but I'd like it to be automatically scaleable for more processors.
According to Xl2007 Help it should work fine, any ideas?