Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you delete an image from a google sheet

I would like to remove/delete an image that I inserted into a google sheet. I used the code:

sheet.insertImage(url,col,row);

to insert the image. But, I want to remove the image later in the code and insert a different image. or not have an image at all.

like image 755
user3158459 Avatar asked Jul 02 '15 12:07

user3158459


1 Answers

Try the following:

      // Deletes all images in sheet
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheet = ss.getSheetByName("Your Tab Name");
      var images = sheet.getImages();
      images.map(function(img){img.remove();});
like image 177
Sherm4n Avatar answered Oct 03 '22 21:10

Sherm4n