TypeError:无法读取属性' getrange'不确定的
为什么Google表中的AppScript找不到表格中的范围?电子表格搜索会在第6行中显示错误,但在第6行中显示
错误。我尝试了Activerange,只是在表格中定义了这一点,但是我总是看到此错误。
请帮助我我不是程序员。
以下是我的功能:
function sendEmailtoworkers() {
let ss = SpreadsheetApp.getActiveSpreadsheet();
let sheet = ss.getSheetByName('number')[0];
let list = sheet.getRange(2,2,9,2);
MailApp.sendEmail( list, "пупкин", "Пожалуйста, зайди на этот файл: docs.google.com/spreadsheets/d/…);
}
Why AppScript in google sheets doesn't find the range in the sheet?The SpreadsheetApp finds the sheet but shows error in line 6.
I tried ActiveRange and just getRange defining this in the sheet, but I always see this error.
Please help me I'm not a programmer.
Below is my function:
function sendEmailtoworkers() {
let ss = SpreadsheetApp.getActiveSpreadsheet();
let sheet = ss.getSheetByName('number')[0];
let list = sheet.getRange(2,2,9,2);
MailApp.sendEmail( list, "пупкин", "Пожалуйста, зайди на этот файл: docs.google.com/spreadsheets/d/…);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
getSheetbyName('number')
将为您提供表格对象,您正在尝试访问[0]
,从中返回undefined
。您可以使用
或
getSheets()
返回表对象列表,可以通过索引访问。要了解更多信息,单击此处!
getSheetByName('number')
will give you the sheet object, you're trying to access[0]
from that, which returnsundefined
.You can either use
or
getSheets()
returns list of sheet objects, you can access through index.To know more, click here!