Consulting

Results 1 to 8 of 8

Thread: Excel CalCulation Issue

  1. #1
    VBAX Regular
    Joined
    Jul 2010
    Posts
    15
    Location

    Excel CalCulation Issue

    Hello and Happy New Year,

    I am having a mysterious Excel Calculation issue.
    Workbook Calculation is set to Automatic.
    When the workbook Opens, I enable Automatic Calculation as well.

    Most of the cell references on other worksheets are just simple stuff like =Data!A1.
    Yet nothing updates unless I select the cell as if I was going to edit the formula, and then hit enter.
    Then it will update. But I can’t really do that with 1000s of cells.

    The problem sometimes goes away if I completely close Excel, then reopen.
    But sometimes that doesn’t work either.

    Does anyone have any ideas here?

    Thanks in advance….

    C.R.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Workbook Calculation is set to Automatic.
    When the workbook Opens, I enable Automatic Calculation as well.
    Where and How?

    More importantly, it sounds like that there is a procedure(s) that set Calculation to Manual without resetting it. Possibly a Selection_Change Sub.

    Use the VBE Menu Edit >> Find >> Find What:="Calculation" >> Search:=Current Project
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Jul 2010
    Posts
    15
    Location
    SamT,

    Where: File>>>Options>>>Formulas>>> Workbook Calculation>>> Automatic Radio Button is selected.

    How: In a ThisWorkBook Module (From The Tips and Tricks Sticky)

    Private Sub Workbook_Open()
        Application.OnTime Now, "ContinueOpen"
    End Sub
    "ContinueOpen" is:

    Sub RestoreSheetsCalculation()
      Dim sh As Worksheet
      For Each sh In Worksheets
        sh.EnableCalculation = True
      Next
      Application.EnableEvents = True
      Application.Calculation = xlCalculationAutomatic
    MsgBox "Auto-Calculation Enabled."
    End Sub
    I've checked all the other Modules and there isn't anything that would disable Automatic Calculation.
    This is what's weird here. It is an intermittent problem with a workbook that gets used, by me only, on a daily basis.

    Thanks for your help.

    C.R.
    Last edited by Aussiebear; 01-08-2014 at 03:19 PM. Reason: wrapped code with tags

  4. #4
    Rename "RestoreSheetsCalculation" to "ContinueOpen", otherwise the OnTime event in Workbook_Open has no macro to run.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Q: Any chance that something turns off .EnableEvents? WB_Open wouldn't run I believe if Excel is already open, and then you open a WB with a WB_Open event (I have a number of WB's in which I disabled events, and the macro crashed before I could re-enable events)

    Q: Can you just move the RestoreSheetsCalculation code into the WB open event without using OnTime?

    Paul

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Another thing to try is putting or calling RestoreSheetsCalculation in the Workbook_BeforeSave Event sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #7
    VBAX Regular
    Joined
    Jul 2010
    Posts
    15
    Location
    Sorry... I wasn't Clear above.

    Continue Open Module Calls RestoreSheetsCalculation.

    I will check out and try all suggestions. Yesterday everything was normal... no issues.
    I'll also re-scour all the other macros in this WB for anything related to Paul's thought that something is getting turned off somewhere. This makes sense.
    It still is the intermittent occurrences of this issue that has me baffled.

    SamT your suggestion above in post #2 was most helpful too. The only place where "calculation" was found was in what I posted in post #3.

    Many thanks guys,

    C.R.

  8. #8
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,645
    Check:

    File/Options/advanced/When calculating this workbook/Update links to other workbooks

Posting Permissions

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