I 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. As many of you know, I have submitted multiple questions about problems to do with Excel.
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 Excel-JS 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.
Here is my 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;
}
What changes do I need to make?
What I have tried:
I have tried embedding the spreadsheet on the website, but I was quickly shut down in that endeavor due to a misunderstanding of how servers and browsers work together.
I have also tried writing to excel with EPPlus, but again there was a disconnect between the client and server.