# GrapeCity.Spreadsheet.Commands.CommandManager.Execute

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Commands_CommandManager_Execute_" data-uid="GrapeCity.Spreadsheet.Commands.CommandManager.Execute*">Execute Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Commands_CommandManager_Execute_" data-uid="GrapeCity.Spreadsheet.Commands.CommandManager.Execute*"></a>
<h4 id="GrapeCity_Spreadsheet_Commands_CommandManager_Execute_GrapeCity_Spreadsheet_Commands_Command_GrapeCity_Spreadsheet_IWorkbook_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Commands.CommandManager.Execute(GrapeCity.Spreadsheet.Commands.Command,GrapeCity.Spreadsheet.IWorkbook,System.Boolean)">Execute(Command, IWorkbook, bool)</h4>
<div class="markdown level1 summary"><p>Executes the specified command.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual CommandResult Execute(Command command, IWorkbook workbook = null, bool notifyUI = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function Execute(command As Command, Optional workbook As IWorkbook = Nothing, Optional notifyUI As Boolean = True) As CommandResult</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.Commands.Command.html">Command</a></td>
      <td><span class="parametername">command</span></td>
      <td><p>The command to be executed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IWorkbook.html">IWorkbook</a></td>
      <td><span class="parametername">workbook</span></td>
      <td><p>The workbook that the command executes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">notifyUI</span></td>
      <td><p><code>true</code> if change(s) is notified to control; otherwise, <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">CommandResult</span></td>
      <td><p>An <span class="xref">GrapeCity.Spreadsheet.Commands.CommandResult</span> struct which contains information about the execution of action.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_Commands_CommandManager_Execute_GrapeCity_Spreadsheet_Commands_Command_GrapeCity_Spreadsheet_IWorkbook_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>If the command is no longer belong to the undo or redo list, it'll be disposed.</p>
</div>
</div>
