2

I need to add some navigation to a report made in Google Sheets. It has many sheets, and I added some hyperlinks so that the user can click them and quickly move to the relevant sheet or range. It works fine in the editor and if I share in view only mode, but I need to publish and embed it in a web page.

When I embed it in an Iframe, the hyperlinks open a new browser tab always in the first sheet. The functions are like this:

=HYPERLINK("#rangeid=706068501";"Link to Sheet 3")

In this post: Navigation in published Google Sheets, it was pointed out that I should reference the gid of the sheet in question in the functions and I did so using the URL of the published sheet. This works, save for the fact that it opens a new browser tab when I click the link.

However, what I need is for the link to open the corresponding sheet inside the iframe, preferably without reloading the whole page.

Is this possible? How can I go about it? If there is another way to ease navigation in a google spreadsheet in an iframe I am more than open to it.

Thanks.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Danf
  • 1,409
  • 2
  • 21
  • 39
  • Just in case anyone is following this, I am trying to intercept the click event in the iframe, so when a hyperlinked is clicked I can cancel the default action (follow the link), and change the src of the iframe to the appropriate gid. It should work, but I can't intercept the click event if the iframe is not in my own domain... looking for a workaround. – Danf Jun 24 '19 at 19:49

0 Answers0