<div class="header-panel member">
<h2><span class="identifier">Workbook</span> Class</h2>
<dl class="dl-horizontal">
<dt>File</dt><dd class="filename">wijmo.xlsx.js</dd>
<dt>Module</dt><dd><a href="topic/wijmo.xlsx.Module.html"><span class="identifier">wijmo.xlsx</span></a></dd>
<dt>Implements</dt><dd><a href="topic/wijmo.xlsx.IWorkbook.Interface.html"><span class="identifier">IWorkbook</span></a></dd>
</dl>
<div class="comment"><p>Represents an Excel workbook.</p></div>
</div>
<div class="member-panel class members" ng-class="{ 'show-inherited' : ctx.showInherited, 'show-raisers' : ctx.showRaisers }">
<h3 class="node">Constructor</h3>
<ul>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#constructor">constructor</a></li>
</ul>
<h3 class="node">Properties</h3>
<ul>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#activeWorksheet">activeWorksheet</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#application">application</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#colorThemes">colorThemes</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#company">company</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#created">created</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#creator">creator</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#definedNames">definedNames</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#lastModifiedBy">lastModifiedBy</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#modified">modified</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#reservedContent">reservedContent</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#sheets">sheets</a></li>
<li class="mproperty"><a href="topic/wijmo.xlsx.Workbook.Class.html/#styles">styles</a></li>
</ul>
<h3 class="node">Methods</h3>
<ul>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#fromXlsxFormat">fromXlsxFormat</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#load">load</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#loadAsync">loadAsync</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#save">save</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#saveAsync">saveAsync</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#tableAddress">tableAddress</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#toXlsxDateFormat">toXlsxDateFormat</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#toXlsxNumberFormat">toXlsxNumberFormat</a></li>
<li class="mmethod"><a href="topic/wijmo.xlsx.Workbook.Class.html/#xlsxAddress">xlsxAddress</a></li>
</ul>
</div>
<h3>Constructor</h3>
<div id="constructor" class="member-panel mmethod">
<h3>constructor</h3>
<pre>constructor(): <a href="topic/wijmo.xlsx.Workbook.Class.html"><span class="identifier">Workbook</span></a></pre>
<div class="comment"><p>Initializes a new instance of the <a href="topic/wijmo.xlsx.Workbook.Class.html"><span class="identifier">Workbook</span></a> class.</p></div>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><a href="topic/wijmo.xlsx.Workbook.Class.html"><span class="identifier">Workbook</span></a></dd>
</dl>
</div>
<h3 class="node">Properties</h3>
<div class="member-list" ng-class="{ 'show-inherited' : ctx.showInherited, 'show-raisers' : ctx.showRaisers }">
<div id="activeWorksheet" class="member-panel mproperty">
<h3>activeWorksheet</h3>
<div class="comment"><p>Gets or sets the index of the active sheet in the xlsx file.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number" target="_blank"><span class="identifier">number</span></a></dd>
</dl>
</div>
<div id="application" class="member-panel mproperty">
<h3>application</h3>
<div class="comment"><p>Gets or sets the name of application that generated the file that appears in the file properties.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
<div id="colorThemes" class="member-panel mproperty">
<h3>colorThemes</h3>
<div class="comment"><p>Gets the color of the workbook themes.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>[]</dd>
</dl>
</div>
<div id="company" class="member-panel mproperty">
<h3>company</h3>
<div class="comment"><p>Gets or sets the name of company that generated the file that appears in the file properties.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
<div id="created" class="member-panel mproperty">
<h3>created</h3>
<div class="comment"><p>Gets or sets the creation time of the xlsx file.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date" target="_blank"><span class="identifier">Date</span></a></dd>
</dl>
</div>
<div id="creator" class="member-panel mproperty">
<h3>creator</h3>
<div class="comment"><p>Gets or sets the creator of the xlsx file.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
<div id="definedNames" class="member-panel mproperty">
<h3>definedNames</h3>
<div class="comment"><p>Gets the defined name items of the workbook.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="topic/wijmo.xlsx.DefinedName.Class.html"><span class="identifier">DefinedName</span></a>[]</dd>
</dl>
</div>
<div id="lastModifiedBy" class="member-panel mproperty">
<h3>lastModifiedBy</h3>
<div class="comment"><p>Gets or sets the last modifier of the xlsx file.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
<div id="modified" class="member-panel mproperty">
<h3>modified</h3>
<div class="comment"><p>Gets or sets the last modified time of the xlsx file.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date" target="_blank"><span class="identifier">Date</span></a></dd>
</dl>
</div>
<div id="reservedContent" class="member-panel mproperty">
<h3>reservedContent</h3>
<div class="comment"><p>Gets or sets the reserved content from xlsx file that flexgrid or flexsheet doesn't support yet.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><span class="identifier">any</span></dd>
</dl>
</div>
<div id="sheets" class="member-panel mproperty">
<h3>sheets</h3>
<div class="comment"><p>Gets the WorkSheet array of the workbook.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="topic/wijmo.xlsx.WorkSheet.Class.html"><span class="identifier">WorkSheet</span></a>[]</dd>
</dl>
</div>
<div id="styles" class="member-panel mproperty">
<h3>styles</h3>
<div class="comment"><p>Gets the styles table of the workbook.</p></div>
<dl class="dl-horizontal">
  <dt>Type</dt><dd><a href="topic/wijmo.xlsx.WorkbookStyle.Class.html"><span class="identifier">WorkbookStyle</span></a>[]</dd>
</dl>
</div>
</div>
<h3 class="node">Methods</h3>
<div class="member-list" ng-class="{ 'show-inherited' : ctx.showInherited, 'show-raisers' : ctx.showRaisers }">
<div id="fromXlsxFormat" class="member-panel mmethod">
<h3><span class="badge">Static</span> fromXlsxFormat</h3>
<pre>fromXlsxFormat(xlsxFormat: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>): <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>[]</pre>
<div class="comment"><p>Converts the xlsx multi-section format string to an array of corresponding wijmo formats.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>xlsxFormat</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a><br/><p>The Excel format string, that may contain multiple format sections
separated by a semicolon.</p></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>[]</dd>
</dl>
</div>
<div id="load" class="member-panel mmethod">
<h3>load</h3>
<pre>load(base64: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>): <span class="identifier">void</span></pre>
<div class="comment"><p>Loads from base-64 string or data url.
This method works with JSZip 2.5.</p>
<p>For example:
</p>

<pre>// This sample opens an xlsx file chosen from Open File
// dialog and creates a workbook instance to load the file.
&nbsp;

// HTML
&lt;input type="file" 
    id="importFile" 
    accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" 
/&gt;
&nbsp;

// JavaScript
var workbook, // receives imported IWorkbook
    importFile = document.getElementById('importFile');
&nbsp;
importFile.addEventListener('change', function () {
    loadWorkbook();
});
&nbsp;
function loadWorkbook() {
    var reader,
        workbook,
        file = importFile.files[0];
    if (file) {
        reader = new FileReader();
        reader.onload = function (e) {
           workbook = new wijmo.xlsx.Workbook(),
           workbook.load(reader.result);
        };
        reader.readAsDataURL(file);
    }
}</pre></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>base64</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a><br/><p>The base-64 string that contains the xlsx file content.</p></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><span class="identifier">void</span></dd>
</dl>
</div>
<div id="loadAsync" class="member-panel mmethod">
<h3>loadAsync</h3>
<pre>loadAsync(base64: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>, onLoaded?: <span class="identifier">(workbook: Workbook)</span>, onError?: <span class="identifier">(reason?: any)</span>): <span class="identifier">void</span></pre>
<div class="comment"><p>Loads from base-64 string or data url asynchronously.
This method works with JSZip 3.0.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>base64</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a><br/><p>base64 string that contains the xlsx file content.</p></li><li><b>onLoaded</b>: <span class="identifier">(workbook: Workbook)</span> <span class="badge">Optional</span><br/><p>This callback provides an approach to get an instance of the loaded workbook.
Since this method is an asynchronous method, user is not able to get instance of
the loaded workbook immediately. User has to get the instance through this callback.
This has a single parameter, instance of the loaded workbook. It will be passed to user.</p></li><li><b>onError</b>: <span class="identifier">(reason?: any)</span> <span class="badge">Optional</span><br/><p>This callback catches error information when loading.
This has a single parameter, the failure reason. Return value is
be passed to user, if he wants to catch the load failure reason.</p>
<p>For example:
</p>

<pre>workbook.loadAsync(base64, function (workbook) {

     // User can access the loaded workbook instance in this callback.
     var app = worksheet.application ;
     ...
}, function (reason) {

     // User can catch the failure reason in this callback.
     console.log('The reason of load failure is ' + reason);
});</pre></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><span class="identifier">void</span></dd>
</dl>
</div>
<div id="save" class="member-panel mmethod">
<h3>save</h3>
<pre>save(fileName?: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>): <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></pre>
<div class="comment"><p>Saves the book to a file and returns a base-64 string representation of
the book.
This method works with JSZip 2.5.</p>
<p>For example, this sample creates an xlsx file with a single cell:</p>


<pre>function exportXlsx(fileName) {
    var book = new wijmo.xlsx.Workbook(),
        sheet = new wijmo.xlsx.WorkSheet(),
        bookRow = new wijmo.xlsx.WorkbookRow(),
        bookCell = new wijmo.xlsx.WorkbookCell();
    bookCell.value = 'Hello, Excel!';
    bookRow.cells.push(bookCell);
    sheet.rows.push(bookRow);
    book.sheets.push(sheet);
    book.save(fileName);
}</pre>
<p>The file name is optional. If not provided, the method still returns
a base-64 string representing the book. This string can be used for
further processing on the client or on the server.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>fileName</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a> <span class="badge">Optional</span><br/><p>Name of the xlsx file to save.</p></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
<div id="saveAsync" class="member-panel mmethod">
<h3>saveAsync</h3>
<pre>saveAsync(fileName?: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>, onSaved?: <span class="identifier">(base64?: string)</span>, onError?: <span class="identifier">(reason?: any)</span>): <span class="identifier">void</span></pre>
<div class="comment"><p>Saves the book to a file asynchronously.
This method works with JSZip 3.0.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>fileName</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a> <span class="badge">Optional</span><br/><p>Name of the xlsx file to save.</p></li><li><b>onSaved</b>: <span class="identifier">(base64?: string)</span> <span class="badge">Optional</span><br/><p>This callback provides an approach to get the base-64 string
that represents the content of the saved workbook. Since this method is an
asynchronous method, user does not get the base-64 string immediately.
User has to get the base-64 string via this callback.
This has a single parameter, the base-64 string of the saved workbook.
It will be passed to user.</p></li><li><b>onError</b>: <span class="identifier">(reason?: any)</span> <span class="badge">Optional</span><br/><p>This callback catches error information when saving.
This has a single parameter, the failure reason.
Return value will be passed to user, if he wants to catch the save failure reason.</p>
<p>For example:
</p>

<pre>workbook.saveAsync('', function (base64){

     // User can access the base64 string in this callback.
     document.getElementByID('export').href = 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;' + 'base64,' + base64;
}, function (reason){

     // User can catch the failure reason in this callback.
     console.log('The reason of save failure is ' + reason);
});</pre></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><span class="identifier">void</span></dd>
</dl>
</div>
<div id="tableAddress" class="member-panel mmethod">
<h3><span class="badge">Static</span> tableAddress</h3>
<pre>tableAddress(xlsxIndex: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>): <a href="topic/wijmo.xlsx.ITableAddress.Interface.html"><span class="identifier">ITableAddress</span></a></pre>
<div class="comment"><p>Convert Excel's alphanumeric cell, row or column index to the zero-based
row/column indices pair.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>xlsxIndex</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a><br/><p>The alphanumeric Excel index that may include alphabetic A-based
column index and/or numeric 1-based row index, like "D15", "D" or "15". The
alphabetic column index can be in lower or upper case.</p></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><a href="topic/wijmo.xlsx.ITableAddress.Interface.html"><span class="identifier">ITableAddress</span></a></dd>
</dl>
</div>
<div id="toXlsxDateFormat" class="member-panel mmethod">
<h3><span class="badge">Static</span> toXlsxDateFormat</h3>
<pre>toXlsxDateFormat(format: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>): <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></pre>
<div class="comment"><p>Converts the wijmo date format to Excel format.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>format</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a><br/><p>The wijmo date format.</p></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
<div id="toXlsxNumberFormat" class="member-panel mmethod">
<h3><span class="badge">Static</span> toXlsxNumberFormat</h3>
<pre>toXlsxNumberFormat(format: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a>): <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></pre>
<div class="comment"><p>Converts the wijmo number format to xlsx format.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>format</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a><br/><p>The wijmo number format.</p></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
<div id="xlsxAddress" class="member-panel mmethod">
<h3><span class="badge">Static</span> xlsxAddress</h3>
<pre>xlsxAddress(row: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number" target="_blank"><span class="identifier">number</span></a>, col: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number" target="_blank"><span class="identifier">number</span></a>, absolute?: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Boolean" target="_blank"><span class="identifier">boolean</span></a>, absoluteCol?: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Boolean" target="_blank"><span class="identifier">boolean</span></a>): <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></pre>
<div class="comment"><p>Converts zero-based cell, row or column index to Excel alphanumeric representation.</p></div>
<dl class="dl-horizontal">
  <dt>Parameters</dt><dd></dd>
</dl>
<ul>
<li><b>row</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number" target="_blank"><span class="identifier">number</span></a><br/><p>The zero-based row index or a null value if only column index
is to be converted.</p></li><li><b>col</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number" target="_blank"><span class="identifier">number</span></a><br/><p>The zero-based column index or a null value if only row index
is to be converted.</p></li><li><b>absolute</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Boolean" target="_blank"><span class="identifier">boolean</span></a> <span class="badge">Optional</span><br/><p>True value indicates that absolute indices is to be returned
for both, row and column (like $D$7). The <b>absoluteCol</b> parameter allows
to redefine this value for the column index.</p></li><li><b>absoluteCol</b>: <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Boolean" target="_blank"><span class="identifier">boolean</span></a> <span class="badge">Optional</span><br/><p>True value indicates that column index is absolute.</p></li></ul>
<dl class="dl-horizontal">
  <dt>Returns</dt><dd><a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank"><span class="identifier">string</span></a></dd>
</dl>
</div>
</div>
