Insert Image into Spresheet Cell from Drive using Google Apps Script

后端 未结 5 1110
名媛妹妹
名媛妹妹 2020-12-06 08:29

I would like to be able to add an image file into my spreadsheet from Google Drive. I see there is a built-in image function available =image, but this requires a URL and

5条回答
  •  情话喂你
    2020-12-06 08:59

    It is not possible if the drive image file is not public on your google drive, Having said that there is a trick to overcome i.

    First make sure the image file is temporary public on your drive. you can do that also via app script by changing the file permissions to DriveApp.Access.ANYONE, DriveApp.Permission.EDIT. Then the drive file is like a file as if it was from the internet. You can then add the blob.

    After that you can decide two things. Change the permissions back or remove the image file from your drive (if you only want to use it embedded in your blob (also via app script code if you want)

    good luck

提交回复
热议问题