Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Excel Multi Threading and Manual formulas VB Script

Posted on 2016-08-08
2
44 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
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 …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

790 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