Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Mar 2002
    Location
    Cincinnati
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculate documentation error (w2kO2ksr1)

    I've just discovered that Application.Calculate and Calculate do different levels of recalculation, even though the Help says they are identical. It looks like "Calculate" is the same as "ActiveWorksheet.Calculate" rather than "Application.Calculate". This should be fixed in the help, because it can lead to very subtle and hard to track errors.

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Calculate documentation error (w2kO2ksr1)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Bill

    I checked the MS-Excel 2002 help file and it said:

    Calculate Method
    Calculates all open workbooks, a specific worksheet in a workbook, or a specified range of cells on a worksheet, as shown in the following table.

    To calculate Follow this example
    All open workbooks Application.Calculate (or just Calculate)
    A specific worksheet Worksheets(1).Calculate
    A specified range Worksheets(1).Rows(2).Calculate

    expression.Calculate

    expression Optional for Application, required for Worksheet and Range. An expression that returns an object in the Applies To list.

    Example
    This example calculates the formulas in columns A, B, and C in the used range on Sheet1.

    Worksheets("Sheet1").UsedRange.Columns("A:C").Calc ulate

    So although the expression is optional, it is always a "best practice" issue to specify it.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Lounger
    Join Date
    Mar 2002
    Location
    Cincinnati
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calculate documentation error (w2kO2ksr1)

    Thanks Wassim, but I must not have made my point clearly. When it says "expression Optional" for Application, this means that "Application.Calculate" and "Calculate" mean the same thing. But in fact they do not. I am not sure exactly what gets calculated with a naked "Calculate" but it is something less than the entire workbook.

    No big deal, and you are right that this just proves that being explicit is always a good idea.

Posting Permissions

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