TypeError:无法读取未定义的属性“值”(第37行,文件“代码”)-Google Apps Scrit

时间:2020-05-06 04:39:38

标签: javascript google-apps-script google-sheets google-docs

我创建了一个Google Apps脚本,允许我从Google表格中创建一些Google文档模板。

这是代码:

<pre style="position: absolute;pointer-events:none">move your mouse to change the path</pre>
<svg width="500" height="500" >
  <path id="path1" d="M 220 104 C 220 144 400 180 400 224"
        fill="none" stroke-width="2" stroke="black" />
  <path d="M0,0 L0,12 L12,6 z" transform="translate(-3,-6)">
    <animateMotion dur="0s" rotate="auto" fill="freeze"
                   keyTimes="0;1" keyPoints="0.5;0.5" calcMode="linear" >
       <mpath xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#path1"/>
    </animateMotion>
  </path>
</svg>

我已将此脚本复制到另一个文件夹,并且不再起作用,它说“ TypeError:无法读取未定义的属性“值”(第37行,文件“代码”)-Google Apps Scrit”。

当我从初始文件夹运行它时,它运行良好。

有人对这个问题有想法吗?

先谢谢您。 马特

1 个答案:

答案 0 :(得分:2)

因此,您需要进行一些更改。

之后

startRowToRange = scriptProps.getProperty('startRow');

添加

if(endRowToRange<startRowToRange) return;

将标题和策略更改为

headers = sh.getRange('A1:I1').getValues();
tactics = sh.getRange(rangeForDate).getValues();

而不是tactic.values只使用战术