how can I open a excel file directly with google sheets api
Not to my knowledge, however, using the Drive API you can upload and convert an Excel file to Sheets format automatically. This could then be used by the Sheets API. This may or may not work as a substitute in your use case.
Well you can read a .xlsx file as a binary blob from Google Apps Script API. So if you want to read the xlsx formatted file and do all the work of interpreting it yourself, then sure you can. But that's essentially writing the entire MS Excel interpreter in Google Script.
Related
What's an efficient way of making an offline backup of a Google spreadsheet so that it includes its Google script files? It seems that if I use the Download as Microsoft Excel File feature, the downloaded xlsx file does not include any Google script that is part of the spreadsheet.
I saw a post about a command line tool called "Clasp" by Google that can be used but I was hoping to use something that is not so arcane.
I set up a automated job via SAP (SM36) where I recieve a report as an attachment on a regular basis via e-mail (GMail). This is working fine but I just received an .htm file from SAP so that I need to transfer the data into a google or excel sheet. Unfortunately, it is not possible to receive the file directly as a .xlsx file.
I know how I can get the .htm file out of gmail into my drive via GApps Script. The next step is to get the data out of this file into a google spreadsheet. I wasn´t able to figure out how I can do this so I ask you to help me with this regard.
How can I get the data out of the report (.htm file) into a google spreadsheet or directly into a excel sheet via Google Apps Script?
Many thanks in advance!
Best regards,
search(query)
getMessages()
getAttachments()
getDataAsString()
openById(id)
setValues(values)
I would like to convert xlsb format file into google sheets using google app script.
This is not possible
Referring to the documentation here, Google Docs supports:
.xls (if newer than Microsoft® Office 95)
.xlsx
.xlsm
.xlt
.xltx
.xltm
.ods
.csv
.txt
.tsv
.tab
If you need to use an XSLB file, first convert it using Office or another converter to one of the above formats.
Alternatively, if you are skilled and brave, you can tackle the XLSB Specs to see if there is a way to convert the binary to something understandable using Apps Script!
If this is important to you and your business, I suggest you file a well justified feature request so that Google might consider implementing it.
I think it's not possible.
You need to use some MS's tools for converting xlsb to xlsx before anything.
I noticed that when I exported a html spreadsheet with Google Sheets or Excel that functions were translated into literal values. Excel stores functions as Excel 2003 XML files but Google Sheets gives an error when opening such a file.
I'm looking for a human readable, html/xml file capable of storing, editing, displaying spreadsheets with functions across Excel, Google Sheets and possibly an email or webpage.
There currently is no known solution other than converting back and forth between Excel and Google Docs.
I usually use google cloud connect. wondering if I have spreadsheet always sync with my updated xlsx automatically. It's look like import button in spreadsheet or upload button in google drive, I think. How do apps script do this case?
we all expect to have a "convertToGDocsFormat" member in File's DocsList API. (Actually, we expect the makeCopy member to have an option to convert it in the copy process.)
But DocsList API is experimental and perhaps incomplete, it doesn't have such method yet.
For now you can't convert a file to Google format from a script.
There is another (long) way to read data from a xlsx. Supposed you have the xlsx file sync'ed. You can access it using the experimental DocsList API, and get a blob.
XLSX file is a ZIP file you can unzip with Utilities.unzip not documented method that gives you an un zipped blob.
Then you have to navigate the tree folder (in the blob) to get the XML files you want to read (from the blob). This tree folder and its XML files describe the entire XLSX spreadsheet.
Finally you may parse such XML file and navigate trough it and get cells' values.
This is not quick to code, nor to execute.