# GrapeCity.Spreadsheet.CalculationEngine.Calculate

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_CalculationEngine_Calculate_" data-uid="GrapeCity.Spreadsheet.CalculationEngine.Calculate*">Calculate Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_CalculationEngine_Calculate_" data-uid="GrapeCity.Spreadsheet.CalculationEngine.Calculate*"></a>
<h4 id="GrapeCity_Spreadsheet_CalculationEngine_Calculate" data-uid="GrapeCity.Spreadsheet.CalculationEngine.Calculate">Calculate()</h4>
<div class="markdown level1 summary"><p>Calculates all dirty cells in the whole workbook set.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Calculate()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Calculate()</code></pre>
</div>


<a id="GrapeCity_Spreadsheet_CalculationEngine_Calculate_" data-uid="GrapeCity.Spreadsheet.CalculationEngine.Calculate*"></a>
<h4 id="GrapeCity_Spreadsheet_CalculationEngine_Calculate_GrapeCity_Spreadsheet_IWorkbook_System_Boolean_System_Boolean_" data-uid="GrapeCity.Spreadsheet.CalculationEngine.Calculate(GrapeCity.Spreadsheet.IWorkbook,System.Boolean,System.Boolean)">Calculate(IWorkbook, bool, bool)</h4>
<div class="markdown level1 summary"><p>Calculates cells in the specified workbook.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Calculate(IWorkbook workbook, bool fullCalculate = false, bool rebuild = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Calculate(workbook As IWorkbook, Optional fullCalculate As Boolean = False, Optional rebuild As Boolean = False)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IWorkbook.html">IWorkbook</a></td>
      <td><span class="parametername">workbook</span></td>
      <td><p>A <span class="xref">GrapeCity.Spreadsheet.Workbook</span> object indicates the workbook to operate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">fullCalculate</span></td>
      <td><p>if set to <code>true</code>, calculates all formulas; otherwise, calculates all formula as needed. Volatile formulas and formulas involved in circular references are always calculated.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">rebuild</span></td>
      <td><p>if set to <code>true</code> the internal data in this <a class="xref" href="GrapeCity.Spreadsheet.CalculationEngine.html">CalculationEngine</a> will be re-build.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_CalculationEngine_Calculate_GrapeCity_Spreadsheet_IWorkbook_System_Boolean_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Rebuild internal data of the <a class="xref" href="GrapeCity.Spreadsheet.CalculationEngine.html">CalculationEngine</a> is a very expensive operation.</p>
</div>


<a id="GrapeCity_Spreadsheet_CalculationEngine_Calculate_" data-uid="GrapeCity.Spreadsheet.CalculationEngine.Calculate*"></a>
<h4 id="GrapeCity_Spreadsheet_CalculationEngine_Calculate_GrapeCity_Spreadsheet_IWorksheet_" data-uid="GrapeCity.Spreadsheet.CalculationEngine.Calculate(GrapeCity.Spreadsheet.IWorksheet)">Calculate(IWorksheet)</h4>
<div class="markdown level1 summary"><p>Calculates cells in the specified worksheet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Calculate(IWorksheet worksheet)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Calculate(worksheet As IWorksheet)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IWorksheet.html">IWorksheet</a></td>
      <td><span class="parametername">worksheet</span></td>
      <td><p>The worksheet to calculate.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
