1

Using Google Apps Script, I seek to extract the cell contents of an Excel file (.xls) (delivered as a Gmail attachment) and deposit those cell contacts into a 2-dimensional javascript array[ ][ ].

var excelFile = GmailApp.getInboxThreads(0,1)[0].getMessages()[0].getAttachments()[0];

At this point, I have a BLOB with ContentType = "application/vnd.ms-excel".

How do I convert this “Excel” blob into a 2D (Google Apps Script / javascript) array I can use?

Illustrative note: I want to do what’s described here only using Google Apps Script / javascript.

UPDATE: Methods for accomplishing this the way I have described seem sparse. Approaching it differently, perhaps I could (programatically) convert the Excel file to a Google Drive Spreadsheet? Then the data extraction is trivial using Google Apps Script. Perhaps someone from Google support could explain how to programatically convert an Excel file in a Gmail attachment to a Google Drive spreadsheet using Google Apps Script?

1 Answer 1

2

There is no way you can do it using Apps Script now, but there is an open issue requesting for this feature. You can star the issue to vote for it and be notified of updates.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.