Deleting images in Google sheet via script error

后端 未结 1 1266
没有蜡笔的小新
没有蜡笔的小新 2021-01-19 03:17

I probably will get downvoted for this but I can\'t do anything else. I searched, read and tried SOOOO many things. I am new at both Javascript and Google platform.

相关标签:
1条回答
  • 2021-01-19 03:51
    • You want to delete the image on Spreadsheet using Google Apps Script.

    If my understand is correct, I think that delete() might be new method which will be added for Spreadsheet in the near future. So the document is not updated and it might not complete yet. But from the error message, if you want to use the current delete() method, how about this sample script?

    Sample script:

    var images = sheet.getImages();
    var img = images[0];
    img["delete"](); // this one
    

    Note:

    • I think that the detail infomation might be added to this document.
    • In my environment, I could confirm that the image can be deleted by img["delete"](). I think that this is one of new methods.

    If I misunderstand your question, I'm sorry.

    Update at 2018 October 13:

    Now in order to delete the image, the following method can be used. This was confirmed at 2018 October 13.

    var images = sheet.getImages();
    var img = images[0];
    img.remove(); // Here
    

    Update at 2018 October 31:

    This was officially released at October 30, 2018.

    You can see the document at Class OverGridImage.

    0 讨论(0)
提交回复
热议问题