09 July 2014

Help needed for iframe code for embedding a spreadsheet

I need help. After days of trying to edit some <iframe> code, hopefully someone out there will come to my rescue before I need psychiatric help as well!

I want to display a section of a Google Sheet on a web page where someone can enter something in one cell and view some data related to that entry.

The Google publishing suggestion provides this code

<iframe src="https://docs.google.com/spreadsheets/d/1AxmM43iugG3eAViyK_ip_I0Z9gSFxLI4BfUuHkT8ouY/pubhtml?widget=true&amp;headers=false"></iframe>

which produces this result.


That is neither editable nor displays any results either. Basically it's not much better than a picture! I suppose it might update as and when I change the source sheet but that's it.

Looking around (and believe me I have looked around) I discovered some alternative code. So I tried this:

<iframe width=500 height=437 src="https://docs.google.com/spreadsheet/ccc?key=1AxmM43iugG3eAViyK_ip_I0Z9gSFxLI4BfUuHkT8ouY"></iframe>

which produces this result and I have used something like this in the past (but annoying people kept fiddling with the formuale) :






That is 'live' and you can put either AH or AH2 in the box and get different displays which is what I want. However, this also shows the toolbar so anyone can mess around with formulae or lose it completely if they're that way inclined.

I am sure there must be a way to display just a selection of cells but none of the &range=A1:K10 type additions to the code have worked. I am pretty sure I am merely missing something obvious or just not entering the extra bit of code correctly but I can't figure out what is correct. If someone out there has a few minutes I would very much appreciate some code that works.

I think I have set permissions so that only B2 can be edited but even that was a lot more complicated that in needed to be. Basically, I had to protect ranges column A, Row 1, B3:J100 and K1:Z100 individually. That still leaves a pile of columns and rows that people can get at but I can extend the 100 to something bigger. While anyone can just add a new row column from the menu, though, there's not much point!

So I do hope someone has some bright ideas.


No comments: