可以在Google App Script中使用Google Spreadsheet功能吗? [英] Possible to use Google Spreadsheet functions in Google App Script?

查看:169
本文介绍了可以在Google App Script中使用Google Spreadsheet功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在为Google Spreadsheet编写一个脚本,该脚本发现某些历史股价。我发现Google应用程序脚本中的FinanceApp服务已被弃用,Google电子表格中的GOOGLEFINANCE()函数似乎取而代之。但是,当我只需要一个单元格时,它将返回一个数组,并且该数组正在分散作品。

所以我想编写一个简短的脚本来调用GOOGLEFINANCE()电子表格函数,并从返回的数组中找到我需要的1条信息由GOOGLEFINANCE()提供。但是,我找不到在脚本中访问电子表格函数(SUM,VLOOKUP,GOOGLEFINANCE等)的方法。

有没有办法在脚本中访问这些函数?或者,是否有一项新服务取代了弃用的FinanceApp服务?

非常感谢您的任何帮助!

解决方案

Google Apps脚本不支持本地电子表格功能。



您最终可能会使用一种麻烦的解决方法,一个在其中写入公式的单元格(在写入和读取中都使用脚本),但这会比实际和/或速度要慢。


I just discovered Google App Scripts, and I'm stumped on something already...

I am trying to write a script for a Google Spreadsheet which finds certain historical stock prices. I found that the FinanceApp service within Google App Scripts has been deprecated, and seemingly replaced by the GOOGLEFINANCE() function within Google Spreadsheets. However, it returns an array, when I need only a single cell, and the array is mucking up the works.

So I'd like to write a short script that calls the GOOGLEFINANCE() spreadsheet function, and finds just the 1 piece of info I need from the array which is returned by GOOGLEFINANCE(). However, I cannot find a way to access Spreadsheet Functions (SUM, VLOOKUP, GOOGLEFINANCE, etc) within a script.

Is there a way to access these functions in a script? Or perhaps, is there a new service which replaces the deprecated FinanceApp service?

Many thanks for any assistance!

解决方案

Native Spreadsheet functions are not supported in Google Apps Script.

You could eventually use a somewhat cumbersome workaround by reading the value of a cell in which you write a formula (using script in both write and read) but this will be less than practical and / or fast.

这篇关于可以在Google App Script中使用Google Spreadsheet功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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