I have implemented a calculator in a Google Sheet, and would like to embed it in my website. There will be multiple users. They should be able to enter numbers and see the result, perhaps with a chart, right there in the web page. I do not want to give them full access to the spreadsheet. How do I do this?
A Google Sheet can be embedded in a web site, but all changes by users are saved automatically and right away, and users see each other's changes in real time. Further, in order to enter numbers in cells, the users will need edit access to the spreadsheet. You can embed the spreadsheet so that the menu bar is not visible, but a determined user with edit access will still be able to make a copy of the original if they really want it.
See this web page for an example of what an embedded spreadsheet looks like.
You may want to take a look at this example:
- Web App - basically a form that lets you enter parameters and show the result
- Google Sheet - all the code is here.
This demo web app sends data from the form to the spreadsheet where a
doGet() function stores it in a row. The results are calculated using array formulas, and returned to the form for display to the user.
For more information, see:
To try it out yourself, open the Google Sheet and choose File > Make a copy.