Solved

Excel Multi Threading and Manual formulas VB Script

Posted on 2016-08-08
2
40 Views
Last Modified: 2016-09-10
HI
I want to be able to create a XLAM file using Vbscript that will do 2 things
1 = Set formula calculation to manual and calculate before save to True
2 = Disable Multi thread calculation

I can get the disable multi thread calc to work using this script and placing he xlam file in the XLStart

Private Sub Workbook_Open()
    ' Disable MultiThreaded Calculation '
    Application.MultiThreadedCalculation.Enabled = False
     
    ' Other options '
   
    ' Automatic Mode '
    ' Application.MultiThreadedCalculation.ThreadMode = xlThreadModeAutomatic '
   
    ' Manual Mode '
    ' Application.MultiThreadedCalculation.ThreadMode = xlThreadModeManual '
   
    ' Use 2 CPU '
    ' Application.MultiThreadedCalculation.ThreadCount = 2 '
   
End Sub

But when I try to add in the manual formula part using this script it does not work

Application.Calculation = xlManual
    Application.CalculateBeforeSave = True

Can you help me as I am not at all good with VB script
Thanks Marcus
0
Comment
Question by:nathantrevor
  • 2
2 Comments
 
LVL 18

Accepted Solution

by:
xtermie earned 500 total points (awarded by participants)
ID: 41765254
Try doing it before you disable multi thread calcs
Private Sub Workbook_Open()
 Application.Calculation = xlManual
 Application.CalculateBeforeSave = True
 ' Disable MultiThreaded Calculation '
 Application.MultiThreadedCalculation.Enabled = False
....
End Sub

Open in new window

0
 
LVL 18

Expert Comment

by:xtermie
ID: 41792449
Provided code based on question but no feedback from author
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question