title: Sheet names office js
body: <p>I'm trying to recieve the sheet names in an external Excelfile, but i only get an empty array.</p>
  <pre><code>async function insertSheets() {
  const myFile = &lt;HTMLInputElement&gt;document.getElementById(&quot;file&quot;);
  const reader = new FileReader();
  
  reader.onload = (event) =&gt; {
  Excel.run(async (context) =&gt; {
    // Remove the metadata before the base64-encoded string.
    const startIndex = reader.result.toString().indexOf(&quot;base64,&quot;);
    const workbookContents = reader.result.toString().substr(startIndex + 7);
  
    // Retrieve the workbook.
    const workbook = context.workbook;
    
    
    // Set up the insert options.
    var options = {
      sheetNamesToInsert: [], // Insert all the worksheets from the source workbook.
      positionType: Excel.WorksheetPositionType.after, // Insert after the `relativeTo` sheet.
      relativeTo: &quot;Sheet1&quot;
    }; // The sheet relative to which the other worksheets will be inserted. Used with `positionType`.
  
    // Insert the workbook.
    //workbook.insertWorksheetsFromBase64(workbookContents, options);
    var names = context.workbook.names;
    names.load();
    await context.sync();
    console.log(JSON.stringify(workbook.names))
    return context.sync();
    
  });
  };
  
  // Read the file as a data URL so that we can parse the base64-encoded string.
  reader.readAsDataURL(myFile.files[0]);
  }
  </code></pre>
  <p>The code is mainly from office-js sample code. Any ideas how i can retrieve the sheet names?</p>