google-spreadsheet-api

How to convert an already-uploaded Excel file to Google's spreadsheet format?

别说谁变了你拦得住时间么 提交于 2021-02-18 16:42:25
问题 I need to convert Excel files already uploaded to Google Drive into Google's spreadsheet format. What is the best way to do that programmatically? I've found this post (#15), but I can't figure out how to use this code. And it seems intended for Excel files not already stored on Drive. Uploading it again would be redundant. 回答1: Unfortunately you cannot convert a file in-place, and you'll need to re-upload it. Here's a sample showing how to use an XLSX file already in your drive: function

Google Script Performance Slow Down

廉价感情. 提交于 2021-02-08 11:47:18
问题 I'm new to Google script. Anyone can give some advice how to improve the coding performance? If the numOfEmail variable is quite a huge number then the performance will slow down. for (var i = 0; i < numOfEmail; i++) { var messages=threads[i].getMessages(); for (var j = 0; j < messages.length; j++) { sheet.getRange("A"+(lastEntry+i)).setValue(messages[j].getId()); sheet.getRange("B"+(lastEntry+i)).setValue(messages[j].getDate()); sheet.getRange("C"+(lastEntry+i)).setValue(messages[j].getFrom(

Find a Google Drive Sheet By Name Using API 4 In Android

柔情痞子 提交于 2021-02-07 11:48:45
问题 I followed the "Android Quickstart" below. https://developers.google.com/sheets/api/quickstart/android Works great. But the sample hard-codes a spreadsheetId to an existing spreadsheet. String spreadsheetId = "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"; I need to be able to find an existing spreadsheet, by name, and store the id (for later use). I'd like to do something like this: private com.google.api.services.sheets.v4.Sheets sheetsService = null; HttpTransport transport = AndroidHttp

How to copy styles of a cell into another one using Google Spreadsheet API

对着背影说爱祢 提交于 2021-02-07 10:20:42
问题 I'm trying to fill data to a spreadsheet using Google Spreadsheet API. What I do not understand is how can I copy styles from a row (e.g. the first one) to the cells created by my software. I'm unable to find a way... 回答1: Read/write styles use google-apps-script, this is the only way to read and write styles that I have seen. source.copyTo(ss.getRange('Sheet2!A1'), {formatOnly: true}); copyTo docs: https://developers.google.com/apps-script/reference/spreadsheet/range#copyTo(Range,Object) No

Google Spreadsheet API v4 to “add a row” in spreadsheet using an “ApiKey”

淺唱寂寞╮ 提交于 2021-02-07 09:49:00
问题 I am trying to use Google Spreadsheet API v4 to "add a row" in spreadsheet using an "ApiKey" directly without using an OAuth 2.0. If I am using OAuth 2.0 its successfully "adding a row" but my requirement is to use "ApiKey" Referred this URL: https://developers.google.com/sheets/api/guides/migration#add_a_new_row_of_data But there is no proper document for using "APIKey ". When I tried using "Apikey" it is throwing me an error of "Unauthorized (401)". 回答1: While the documentation isn't

Google Spreadsheet API v4 to “add a row” in spreadsheet using an “ApiKey”

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 09:48:59
问题 I am trying to use Google Spreadsheet API v4 to "add a row" in spreadsheet using an "ApiKey" directly without using an OAuth 2.0. If I am using OAuth 2.0 its successfully "adding a row" but my requirement is to use "ApiKey" Referred this URL: https://developers.google.com/sheets/api/guides/migration#add_a_new_row_of_data But there is no proper document for using "APIKey ". When I tried using "Apikey" it is throwing me an error of "Unauthorized (401)". 回答1: While the documentation isn't

OnEdit function Does not recognize pasted (ctrl-p) Values as being a cell edit. Is it possible to get it to do so?

别说谁变了你拦得住时间么 提交于 2021-01-28 06:29:39
问题 I've got an script in my google sheet that stamps time codes into specific cells when a name is entered in the column next to it... However the script does not work when the names are copied and pasted into the column... is there a work around for this issue that will trigger the script on a cell having a value pasted into it? script: function onEdit(e) { var s = e.source.getActiveSheet().getName(); var cols = [3, 5, 7, 10, 12, 14, 17, 19, 21]; var curDate = Utilities.formatDate(new Date(),

Can Excel retrieve data from Google Drive Excel spreadsheet?

拟墨画扇 提交于 2021-01-28 03:33:51
问题 Can Excel retrieve data from a Google Spreadsheet? When I open Excel file.. some fields in it need information from a Google Excel spreadsheet. Thanks! 回答1: Yes, it's possible to do this in a basic way without doing any programming: Ensure your Google Spreadsheet has been "Published to Web" In Excel, go to the Data tab and choose to create a new web query "From Web" − paste the link that would have been copied to your clipboard when you published Google's sheet Your Google sheet will now

Can Excel retrieve data from Google Drive Excel spreadsheet?

六月ゝ 毕业季﹏ 提交于 2021-01-28 02:15:56
问题 Can Excel retrieve data from a Google Spreadsheet? When I open Excel file.. some fields in it need information from a Google Excel spreadsheet. Thanks! 回答1: Yes, it's possible to do this in a basic way without doing any programming: Ensure your Google Spreadsheet has been "Published to Web" In Excel, go to the Data tab and choose to create a new web query "From Web" − paste the link that would have been copied to your clipboard when you published Google's sheet Your Google sheet will now

How do I export the revision history of a gdoc to git?

拟墨画扇 提交于 2020-12-27 08:08:40
问题 I have a spreadsheet in google docs that I'd want to integrate in a git workflow (and push to github). Are there any tools (or even libraries that are gdoc version aware) that do, or help me do, that? I have some old ruby hacks lying around based on the google_spreadsheet gem that reads and writes current versions of a csv gdoc, but nothing which extracts revision history. 回答1: gdoc is not set up for exporting revision history source. Google drive does have an API to access all the revisions