Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Workbook Calculation (97:SR2)

    Through code I turn off the automatic calculation and set it to manual, run some more code and then eventually turn on the automatic calculation.

    I have experienced times where the workbook is not fully calculated ie the issue. I thought of putting "calculate" in the code thinking this would resolve the issue but end up with the same issue. Is there a way of forcing a complete calculation of the workbook?

    Thanks,
    John

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Workbook Calculation (97:SR2)

    ctrl-alt -f9
    will do a full recalc.

    F9 is only a partial with things Xl feels have changed and the dependents.

    This site has lots of detail on the excel cals and the dependency trees.

    Steve

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workbook Calculation (97:SR2)

    Try:

    <pre> Application.CalculateFull
    </pre>

    Legare Coleman

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Workbook Calculation (97:SR2)

    In the recent thread starting at <post#=302728>post 302728</post#> we found out that CalculateFull wasn't introduced yet in Excel 97; Steve proposed a workaround using SendKeys:

    SendKeys "%^{F9}", True

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workbook Calculation (97:SR2)

    And if one wants to force the recalc *within the code*:

    Sendkeys "^%{F9}"
    DoEvents

    The DoEvents command forces the keystrokes to be sent immediately and the recalc to occur, as opposed to waiting for the macro to end.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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