Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 对于包含Googlefinance()数据的单元格,Google Sheet getValue()返回不适用_Google Apps Script_Google Sheets_Google Finance_Getvalue - Fatal编程技术网

Google apps script 对于包含Googlefinance()数据的单元格,Google Sheet getValue()返回不适用

Google apps script 对于包含Googlefinance()数据的单元格,Google Sheet getValue()返回不适用,google-apps-script,google-sheets,google-finance,getvalue,Google Apps Script,Google Sheets,Google Finance,Getvalue,我有一个简单的谷歌表单,它使用单元格A2中的=Googlefinance(股票代码,“close”,today()-7,today())检索股票数据(以及ajacent范围)。 当我尝试使用sheet.range(“A2”).getValue()读取脚本中检索到的数据时,脚本在单元格A2中返回“\N/a”,尽管其中显然有“Date”一词。通过sheet.getRange().getValue()检索时,该范围内的所有其他值返回空值。有没有办法用getValue()检索Googlefinance(

我有一个简单的谷歌表单,它使用单元格A2中的
=Googlefinance(股票代码,“close”,today()-7,today())
检索股票数据(以及ajacent范围)。 当我尝试使用
sheet.range(“A2”).getValue()
读取脚本中检索到的数据时,脚本在单元格A2中返回“
\N/a
”,尽管其中显然有“Date”一词。通过
sheet.getRange().getValue()
检索时,该范围内的所有其他值返回空值。有没有办法用
getValue()
检索
Googlefinance()
数据

当我用值(粘贴为值)填充范围时,一切都很好。。。看起来
getValue()
无法读取
Googlefinance()
数据

function UpdateRange() {
var sheet=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
//cell A2 contains formula GOOGLEFINANCE("AAPL","close",today()-7,today())
var fTitle = sheet.getRange("A2").getValue();
//returned value is #N/A
var fDate = sheet.getRange("A3").getValue();
//returned value is an empty string
Logger.log(fTitle); 
Logger.log(fDate);
}

getValue()
语句应返回单元格的实际值,而不是
#N/A
或空单元格。

指定日期范围时,结果不会显示在公式单元格中。相反,它显示在左侧和下方的相邻单元格中