问题
Insert an object in sheets (ex: https://developers.google.com/apps-script/reference/spreadsheet/sheet#insertImage(String,Integer,Integer)):
var obj = sheet.insert{ObjectType}(args.);
You can call your charts in sheets:
var chart = sheet.getCharts()[0].modify().{params}.build;
And can call objects in docs:
docs.getBody().findElement(DocumentApp.ElementType.{object type}, null);
What's the equivalent for finding objects in sheets, i.e. is there a gsheets dom model like there is for docs? or are non-chart objects inaccessible through gAppscript?
//get objects in sheet
var obj2 = sheet.getObject()[0]
//error, method doesn't exist
//
//get objects near a range
var obj3 = sheet.getRange(x,y).getObject()
//error
回答1:
Maybe I'm missing something here, but data in Sheets isn't organized the same way it is in Docs. What kind of "objects" are you trying to find? I think you should be able to retrieve and manipulate most anything with a combination of getRange, getValues, and setValues.
来源:https://stackoverflow.com/questions/27184693/how-do-you-manipulate-an-inserted-object-in-google-sheets