0

have an ASP.Net website which lets the user write to an excel spreadsheet. The values I wish to write are calculated by a client-side Javascript code. I have had multiple problems to do with Excel because of misunderstandings I've had about servers, clients, and browsers.

I think I may have finally found a solution to my dilemma by writing to Excel using client-side Javascript. I found a library called exceljs which has many of the features I am looking for. However, I reached a snag because I'm not sure how to open an existing Excel spreadsheet. I followed the guide in the documentation on npm, but the approach hasn't worked. For context, the spreadsheet I am talking about is accessible to all users and is stored on the website directly under the main directory.

How should I change the code below ?

JavaScript code:

var Excel = require('exceljs');
var openExcel() {
    var workbook = new Excel.Workbook("../Erics_takeoff_101718.xlsx");
    var worksheet = workbook.getWorksheet('PLAN # 1');
    workbook.views = [
        {
            x: 0, y: 0, width: 100, height: 200,
            firstSheet: 0, activeTab: 1, visibility: 'visible'
        }
    ]

    worksheet.state = 'show';
    return false;
}
Eric Lopez
  • 23
  • 2
  • 10

0 Answers0