0

I want a google apps script to re-size row height as per image height in that cell. I don't want to re-size image. I used following code to increase height of row but it do not increase automatically by checking height of image.

function setHeights(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.setActiveSheet(ss.getSheetByName("Question Bank"));
var range = sheet.getDataRange();
var numRows = range.getNumRows();
for(var i=1; i<=numRows; i++){
 sheet.setRowHeight(i, 21)};
};
  • this should help you : http://stackoverflow.com/questions/19257264/how-to-get-the-size-in-pixels-of-a-jpeg-image-i-get-with-urlfetchapp-fetchpho – Serge insas Dec 12 '15 at 22:08

1 Answers1

0

Mohammad,

Maybe I'm wrong but I think the problem is that in Google Sheets the images you insert are not related to a specific cell, so you can't get the image height to modify a row height because there is no way in the Sheets App Script to access that value of the respective image.

Hope this answer helps.