Hi, I want to get some columns from one excel file and update the same to another excel file… I tried to load the file using activex but its showing some error in vscode editor
"Uncaught ReferenceError: Excel is not defined" pls help!!
sample code that I got from google
var workbook = new Excel.Workbook();
workbook.xlsx.readFile("c://users/user/desktop/Test.xlsx").then(function () {
var worksheet=workbook.getWorksheet('Sheet1');
//Get Lastrow
var row = worksheet.lastRow
//Update a cell
row.getCell(1).value = 5;
row.commit();
//Save the workbook
return workbook.xlsx.writeFile("c://users/user/desktop/Test.xlsx");
});
1 Like
@Jyosiva,
from what I understand you are trying to import an excel spreadsheet in JS and exporting the data from that spreadsheet into another.
A quick search online yielded the following resources:
Hope that helps
Problem #1:
<script src="https://cdn.jsdelivr.net/npm/exceljs@1.13.0/dist/exceljs.min.js"></script>
⋮
<script>
⋮
var workbook = new ExcelJS.Workbook;
⋮