Above a frozen row I want to put an image that is linked to a script; e.g. click the image and a script runs.
I can insert an image and add a script to it, problem: can only be
done under frozen row.
I can insert an image using =image("imageurl";2), I can even put a
hyperlink to this =hyperlink("url"; image("imageurl";2)) and this
works nicely but I can't call a script.
Any ideas on how to solve this?
How do you add UI inside cells in a google spreadsheet using app script? ... shows how to insert a drawing and link it to a script. Unfortunately, as you've found, floating images are not allowed in frozen rows or columns, so that technique breaks down if you must freeze rows. A quick search on the interwebs will show that this has been a long-term complaint about Google Sheets. (For instance.)
There are options, none of them ideal:
Use a custom menu function instead. That means users need to hunt a bit to find the menu option to kick your script, but it does stay in view no matter where they are.
Use the hyperlink & image work-around you've described, but use a published script url as the target. That will allow you to run a google apps script, indirectly.
Use a sidebar. OK, this isn't actually supported in Sheets yet - visit Issue 3162 and star it for updates.
Related
In any Google Sheet, select a cell containing a formula, for example, =SUM(1,1). You'll see that both the Insert->Link menu
and the toolbar button for Insert Link (Ctrl + K) are disabled.
Why is that?
PS:
I've spent considerable time on Google, but I haven't found this issue mentioned anywhere.
This problem occurs irrespective of whether the formula has been manually typed in the cell or been populated through Apps Script.
This is intended behaviour
If you press Ctrl+K when a cell with a formula is highlighted you get the following message:
Not sure if this applies to you, but I solved my problem after coming here. I realized that where I was trying to change the links was actually an "importrange" of another file. So I have a daily sales ticker that feeds out to our salespeople, but I don't want them to "see" my live file and accidentally make changes. So I use "importrange" to show just one page of my big file to the salespeople and if they accidentally make a change, it doesn't affect my original formulas. I was trying to update the links on the "shared version". Once I went to my original file, I could update the links as expected. It was ODD though that I was able to delete the link on the shared page. Just couldn't edit it or create a new link there.
I have a Google Apps Script custom function, very simple:
function sharesBurned(sharesToSell) {
return "tree"
}
Obviously, this works when I test it in Apps Script. In my sheet, when I call it in a cell, sharesBurned(2), for instance, it sometimes returns "Loading", and in the upper right hand corner of the cell, a red triangular sign appears that, when hovered over, reads: "Error - Loading data...".
I know there have been several threads on this, but they are pretty old, and I've tried all the suggestions already to no avail, namely:
Changing the function name
Refreshing the spreadsheet
Toggling Parameter Cell
Duplicating the spreadsheet
Clearing Browser cache / cookies
To be clear, the function loads in the cell seamlessly half the time and the other half is stuck like this. I highly doubt it's an issue with the script itself so this is likely some weird bug (caching? no clue) with Google Sheets.
This seems to be a issue on Google's server. There is already an active report about Google sheets custom functions stuck in loading. You may want to click the star icon on the top left of the issue report to indicate that you are also being affected by the issue.
Other related issues:
Apps script taking too much time to read from Google sheets
Apps script taking too much time to read from Google sheets charts
I have a google sheet that is to be used by a third person.
The sheet contains a column that requires them to upload an image into the cell (using Google Sheets Image In Cell feature).
I want to be able to via Google Apps Script, save these images, with an appropriate name based on a value in the row, to a folder in my Google Drive.
Is this possible?
As #Tanaike said, there is currently no way to do that automatically unless you get the URL and doesnt work on generated images (like QR codes) either. Not even right click works for such.
Externally, the only solution for the moment would be to manually get a screen capture (the 'recortes' tool in Windows can help). To automate this you could do a script to move the browser, then take a capture and save it, then move the browser again, rinse and repeat , but still there is no direct solution inside Google Sheets.
I've got a Google Form which is attached to a spreadsheet and a script. It's got one radio button field. When a choice is made, I want to run the script to remove the choice from the list. So far so good - I've got this working well.
However, when I use images with the choices, the script removes all of the images. Is there a way of not deleting the images? Or at least a way of accessing the images associaed with a Choice to get me started?
I'm building a dashboard in Google Spreadsheets and want to include some images to be shown when certain rows are hidden/shown. Is this possible? I've used insertImage to insert the image but I can't find a way to delete or hide the image (hiding the rows does not affect images).
Any ideas?
There is no straightforward way of removing an image from the Apps Script API. Even if you delete a row, the image will still remain.
You should raise a request for this feature in the Issue Tracker ( http://code.google.com/p/google-apps-script-issues/issues/list ) .
EDIT:
Looks like there is already a very old issue for this https://code.google.com/p/google-apps-script-issues/issues/detail?id=64 . Along with a workaround mentioned there
Why don't you directly use the spreadsheet native function =Image(URL,section), it will be show or hide with the cells