# GrapeCity.Spreadsheet.INames.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_INames_Add_" data-uid="GrapeCity.Spreadsheet.INames.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_INames_Add_" data-uid="GrapeCity.Spreadsheet.INames.Add*"></a>
<h4 id="GrapeCity_Spreadsheet_INames_Add_System_String_System_String_System_String_System_Int32_System_Int32_System_Nullable_System_Boolean__" data-uid="GrapeCity.Spreadsheet.INames.Add(System.String,System.String,System.String,System.Int32,System.Int32,System.Nullable{System.Boolean})">Add(string, string, string, int, int, bool?)</h4>
<div class="markdown level1 summary"><p>Creates a new defined name.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IName Add(string name, string refersTo, string comment = null, int contextRow = 0, int contextColumn = 0, bool? isA1StyleNotation = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Add(name As String, refersTo As String, Optional comment As String = Nothing, Optional contextRow As Integer = 0, Optional contextColumn As Integer = 0, Optional isA1StyleNotation As Boolean? = Nothing) As IName</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">name</span></td>
      <td><p>A string value indicates the name of new defined name.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">refersTo</span></td>
      <td><p>A string value indicates the formula which new defined name refers to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">comment</span></td>
      <td><p>A string value indicates the comment of new defined name.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">contextRow</span></td>
      <td><p>An integer value indicates the context row related to <code class="paramref">refersTo</code> formula.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">contextColumn</span></td>
      <td><p>An integer value indicates the context column related to <code class="paramref">refersTo</code> formula.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">isA1StyleNotation</span></td>
      <td><p>A bool? value indicates the notation style of the formula. <code>true</code> means A1-style notation. <code>false</code> means R1C1-style notation. <code>null</code> means current notation style.</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><a class="xref" href="GrapeCity.Spreadsheet.IName.html">IName</a></td>
      <td><p>An <a class="xref" href="GrapeCity.Spreadsheet.IName.html">IName</a> object indicates the new created defined name. <code>null</code> if the input is invalid.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
