Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created a Google Apps Script Project where I write data to a Google spreadsheet. The data to be written is calculated in a Javascript script I added to the project. I added Javascript, HTML, and CSS files according to the Best Practices[^], so that shouldn't be an issue.

The really important thing about the project is open and writing to a Google Spreadsheet and this is where my problem lies. I tried adding code to the Google Script file from Stack Overflow[^], but nothing seems to happen even when I'm only running the gs function used to open the sheet. I'm assuming my problem is I have no designated space for the sheet to open in, but I'm trying to open the sheet in a new tab anyway.

How do I go about opening the Google Sheet with Google Apps Script or even the Javascript file I mentioned?

What I have tried:

I tried separating out the line with openById into its own function called sheetOpen and calling the new function with an html button, but I didn't see anything open.

I also opened the Google Sheet with an HTML element. The address for href is a link generated by sharing the sheet (with editing permissions). I feel this approach would be beneficial for me, but I'm not sure how to write to the Sheet in this case with either the Google Script or Javascript file in the project.
Posted
Updated 20-Oct-18 14:06pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900