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.
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.
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.
I'd like to open a PDF in Google Docs (not the previewer) without having Docs convert the file, 3rd Party PDF Viewers are not an option as I need to run a Google Script on the file also. PDF->Doc conversion is completely useless, as it removes all formatting and leaves a worthless document in it's wake.
No, there is not. Google Apps script DocumentApp can only work with Google Docs type files anyway.
Depending on what you are trying to accomplish you could look at the DriveApp Apis, but any modifications to the Document contents require it to be a google type file.
What I'd like to accomplish: Download a Google Docs doc (with Google Drive API), modify it (for example highlight some text), then store it back to Google Drive (not messing up the format, so that it can be edited in the Google Docs app).
(Preemptive research: I know that you can do some integration with Google's hosted AppScript, but I want to do this offline. I also know that a Google Docs doc can be exported to other formats, but I see no sign of reimporting in the Google Drive API.)
I'm not hopeful this can be done:
* The meta-data file (that you can get via the Google Drive API) lacks a "downloadUrl" attribute
* In offline mode, the data (stored in .../File System/) is binary and the Unix "file " command doesn't know what format it is.
Is this off-limits with the current Google Drive API?
Your best (only) approach is to export the doc to a format that you can edit locally (html, docs, etc) and then reimport it. HTML is of course the easiest, but also the most lossy.
I need to do find and replace in a Google doc. Essentially, I have a template Google Doc that I want to copy and customize, programatically.
The original and the copy should both be in the native Gdoc format, and it should look the same before and after, in terms of visual layout and formatting.
Tried downloading HTML (and other formats) via the exportLink, doing my find-and-replace on the output, then updating the content to be the output of the find-and-replace. But that screws up the formatting, and seems very... roundabout.
I'm using the Ruby client, for what that's worth, but the main question is, what's the best practice for doing a find-and-replace in a native Doc?
I think the easiest solution would be to use the replaceText method of the Document service in Apps Script:
https://developers.google.com/apps-script/class_document#replaceText