How to Hide Images in Google Spreadsheets with Google Apps Script?

若如初见. 提交于 2021-02-08 05:41:43

问题


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?


回答1:


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




回答2:


Why don't you directly use the spreadsheet native function =Image(URL,section), it will be show or hide with the cells



来源:https://stackoverflow.com/questions/15665401/how-to-hide-images-in-google-spreadsheets-with-google-apps-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!