如何在Google表格中操作插入的对象? [英] How do you manipulate an inserted object in Google Sheets?

查看:389
本文介绍了如何在Google表格中操作插入的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作表中插入一个对象(例如: https://developers.google.com/apps-script/reference/spreadsheet/sheet#insertImage(String,Integer,Integer)):

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);

在sheet中查找对象的等价物是什么,也就是说有一个gsheets dom模型,就像docs ?或者是非图表对象无法通过gAppscript访问?

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


推荐答案

也许我在这里错过了一些东西,但Sheets中的数据的组织方式与Docs中的不同。你想找什么样的物体?我认为你应该能够通过 getRange getValues ,和setValues。

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.

这篇关于如何在Google表格中操作插入的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆