I'm trying to export json data to excel using ExcelJS library in angular project. I have followed all the steps present in the following link Export to Excel in Angular using ExcelJS It's working and I'm able to export the data. But the file is being exported as read only file. This is the code which i'm using in my project import { Injectable } from "@angular/core"; import * as ExcelJS from 'exceljs'; import { saveAs } from 'file-saver'; @Injectable() export class ExportService{ exportToExcel(data: any[], fileName: string) { const workbook = new ExcelJS.Workbook(); const worksheet = workbook.addWorksheet('My Sheet'); // Add headers const headers = Object.keys(data[0]); worksheet.addRow(headers); // Add data data.forEach((item) => { const row:any = []; headers.forEach((header) => { row.push(item[header]); }); worksheet.addRow(row); }); worksheet.getColumn(1).width = 15; worksheet.getColumn(2).width = 20; // Generate Excel file workbook.xlsx.writeBuffer().then((buffer: any) => { const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); saveAs(blob, `${fileName}.xlsx`); }); } } Is it an issue in format in File saver js or Excel js?? Continue reading...