THIS message is keep poping up,,

2020-05-05 17:39发布

I am making a code copy from spreadsheet to email however i am getting an error which keeps popping up

<SyntaxError: Unexpected token class('SheetConverter'>

my code.

function myFunction() {


  var s = SpreadsheetApp.getActive().getSheetByName('MAIL');
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var range = ss.getActiveSheet().getDataRange();
  var range = s.getRange('C7:I24');
  var to = "example@ex.com" ;

  var body = "";

  var htmlTable = SheetConverter.convertRange2html(range);
var body = "Here is the table:<br/><br/>"
     + htmlTable
     + "<br/><br/>The end.";


   MailApp.sendEmail(to, 'Subject', body, {htmlBody: body})
}

1条回答
▲ chillily
2楼-- · 2020-05-05 17:55

There is a bug report with respect to v8 support with the SheetConverter library. As a workaround in the short term, you could create the file yourself inside of your project and remove the library reference, copy the source code from here and edit lines 58-60 to read:

function objIsClass_(object,className) {
  return (toClass_.call(object).indexOf(className) !== -1);
}
查看更多
登录 后发表回答