google-apps-script-snippets | Google Apps Script snippets
kandi X-RAY | google-apps-script-snippets Summary
kandi X-RAY | google-apps-script-snippets Summary
The website Google Apps Script snippets ᕦʕ •ᴥ•ʔᕤ.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Formats a number with the given parameters
- Parses a string and returns an error .
- Parse the given signature
- Replaces a string with a replacement .
- Evaluate an expression .
- Sort an array .
- Parse a date to a picture
- Parse an integer picture .
- Parse date time format
- Evaluates the sort expression .
google-apps-script-snippets Key Features
google-apps-script-snippets Examples and Code Snippets
Community Discussions
Trending Discussions on google-apps-script-snippets
QUESTION
I have this sample Google Spreadsheet. I want to create a Google Apps Script function to export only the sheet named "TargetSheet" to Excel. Since TargetSheet might have formulas, it is important that this exportation has only values. Also, the colors and formats are important to be kept.
The final file should look like this.
Someone suggested me to use this snippet to export the sheet, but since I'm a begginner in Google Apps Script I didn't quite understand how to do that. Should I copy it to my code? Should I import it somehow? And after getting this function to work in my script, I assume I would need to create a function to put that to work. Would that look like this below?
...ANSWER
Answered 2020-Mar-03 at 23:18- You want to export one of sheet (
TargetSheet
) in the active Spreadsheet as a XLSX file. - From the sample script of URL in your question, you want to create the XLSX file in your Google Drive.
- You want to achieve this using the sample script of URL in your question with Google Apps Script.
If my understanding is correct, how about this answer? Please think of this as just one of several possible answers.
Flow:When I saw the sample script of URL in your question, it seems that the flow is as follows.
- Copy the active Spreadsheet as a tempora Spreadsheet.
- Convert the formulas to the texts.
- Delete the sheets except for a sheet you want to export.
- Retrieve the export URLs.
- Retrieve the blob from the export URL.
- Crete the blob as a file.
- Delete the temporal Spreadsheet.
In your case, the export type is the XLSX format which is the constant. So I think that the process cost can be reduced a little. So the modified script is as follows.
Sample script:Please copy and paste the following script to the script editor of the Spreadsheet. And please set exportSheetName
. Then, please run the function exportarPlanilha
at the script editor. When the authorization screen is displayed, please authorize the scopes. By this, the script is run.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install google-apps-script-snippets
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page