title: Editing Excel files in Electron app (Node.Js)
body: <p>I have an electron app where I need to read data from an Excel file and write back changed data. I also need to preserve the formatting of the Excel file.</p>
  <p>The Excel file I am using is created with the Excel product part of the Microsoft 365 for Business subscription, version 2005, Build 12827.20268.</p>
  <p>I have read recommendations on SO and decided to give a try to <a href="https://www.npmjs.com/package/exceljs" rel="nofollow noreferrer">exceljs@4.0.1</a>. The issue is that this library gives me an error when I try to save.</p>
  <p>Here is the sample code I am using:</p>
  <pre class="lang-js prettyprint-override"><code>  modifyExcel(): void {
      // create a workbook variable
      const workbook = new Excel.Workbook();
      // read excel file from the path
      workbook.xlsx.readFile(this.excelFile)
        .then(() =&gt; {
          // access the excel sheet
          const worksheet = workbook.getWorksheet('My Sheet');
          const rowValues = ['Case 1', 'case 1 file', '', 2, 3, 4, 5];
          worksheet.addRow(rowValues);
          workbook.xlsx.writeFile(this.excelFile)
            .then(() =&gt; {
              // eslint-disable-next-line no-console
              console.log('saved to excel file successfully');
            });
        });
    }
  </code></pre>
  <p>When I execute the code I get an exception:</p>
  <pre><code>exceljs.min.js?e8ae:3 Uncaught (in promise) TypeError: Cannot read property 'F_OK' of undefined
      at eval (exceljs.min.js?e8ae:formatted:46534)
      at new Promise (&lt;anonymous&gt;)
      at Object.exists (exceljs.min.js?e8ae:formatted:46532)
      at eval (exceljs.min.js?e8ae:formatted:56173)
      at u (exceljs.min.js?e8ae:formatted:56173)
      at Generator.eval [as _invoke] (exceljs.min.js?e8ae:formatted:56173)
      at Generator.forEach.e.&lt;computed&gt; [as next] (exceljs.min.js?e8ae:formatted:56173)
      at n (exceljs.min.js?e8ae:formatted:56173)
      at s (exceljs.min.js?e8ae:formatted:56173)
      at eval (exceljs.min.js?e8ae:formatted:56173)
  </code></pre>
  <p>I debugged the code and the exception occurs on the file writing line.</p>
  <pre class="lang-js prettyprint-override"><code>        workbook.xlsx.writeFile(this.excelFile)
  </code></pre>
  <p>Anybody seen anything like this? If yes, what was your solution.</p>