I am trying to import XLSX data into Google Spreadsheet programmatically without using drive API
**Note: ** Microsoft XLSX file may contain Fomrated text data, functions, Images and Chart data inside it. Import should all kind of data present inside Microsoft XLSX file into Google Sheet
Using “SheetJS” library only the text data was imported but text formatting was lost. Tried few Add-on as well, with the help of Add-on as well I see that text formatting is getting lost and other data like images and charts are also not imported.
Sample Code here which I used:
// Loading SheetJS.
const cdnjs = "https://cdn.sheetjs.com/xlsx-latest/package/dist/xlsx.full.min.js";
eval(UrlFetchApp.fetch(cdnjs).getContentText());
var sharedUrl = 'shared url of XLSX file saved in user's Google drive'; // XLSX Report file saved in google drive shared publicly
var downloadUrl = getDirectDownloadLink(sharedUrl);
// Fetch the XLSX file content as a blob
var response = UrlFetchApp.fetch(downloadUrl);
var fileBlob = response.getBlob();
DriveApp.createFile(fileBlob);
Intezar Alam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.