Results 1 to 6 of 6

Calc set to manual with VBA!

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    387

    Calc set to manual with VBA!

    Hi guys,

    If it is not too much of an inconvenience to ask, I would really appreciate any help on the below.

    I have an excel sheet named 'Planner' which includes a lot of calculations. To cater for this I have included a macro which when the file is opened will switch calculations to manual. Moreover, If someone saves it also disables auto recalculations. Finally when one exists the file automatic calculations will be switched on again. This works fine if I am only using 'Planner'.

    The code I inserted is the below:

    Option Explicit
    
    'when you open the workbook, switches calculation to manual
    
    Private Sub Workbook_Open()
         Application.Calculation = xlManual
    End Sub
    
    
    'when you click save, turn off Calculate Before Save
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
         Application.CalculateBeforeSave = False
    End Sub
    
    'after the save, switch back to normal
    Private Sub Workbook_AfterSave(ByVal Success As Boolean)
         Application.CalculateBeforeSave = True
    End Sub
    Problem

    The only problem I am finding is that if there is another excel file which is already open (which will be on automatic mode), as soon as I open the 'Planner', it freezes everything. I am imagining that this is happening since the other excel file which is already open and is set to automatic calculations is interfering with this code on 'Planner'.

    Can the code above be changed to turn all open files to manual calculations as soon as 'Planner' is opened?

    Really appreciate a lot your help cause I can't seem to find a solution.

    Thanks a lot guys

    Keibri
    Last edited by Keibri; 12-22-2016 at 02:27 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 05-31-2013, 07:17 PM
  2. Change Auto Calc to Manual by default
    By pdhawan in forum Excel General
    Replies: 6
    Last Post: 09-16-2012, 11:21 PM
  3. Using escape to exit manual calc iterations
    By wandb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2008, 07:29 PM
  4. Disable Manual Calc in Options
    By Soltisolti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2008, 12:38 AM
  5. Need 1 cell to be manual & calc'd
    By mlk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2008, 10:30 PM
  6. Manual Calc taking way too long
    By wbd_kelley@yaho in forum Excel General
    Replies: 2
    Last Post: 05-13-2008, 02:06 PM
  7. [SOLVED] Open CSV causes calculation in manual calc mode
    By kunkletown@comcast.net in forum Excel General
    Replies: 0
    Last Post: 07-25-2006, 04:30 PM
  8. Automatic Manual Calc When Opening!!
    By twogoodtwo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2005, 02:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1