保存并访问“命名版本"通过GAS的Google表格 [英] Save & access "named version" of Google Sheet via GAS

查看:71
本文介绍了保存并访问“命名版本"通过GAS的Google表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google表格中,有一个选项可以保存表格的命名版本".我正在寻找一种以编程方式执行此操作的方法.大致来说,我希望按下按钮:

In Google Sheets there is an option to saved a "named version" of a sheet. I am looking for a way to do this programatically. Roughly, I want a button press to:

  • 创建电子表格(data)的新命名版本(例如,"v3")
  • 创建另一个电子表格的副本(calculator)
  • data的"v3"中具有calculator个参考数据.
  • Create a new named version (eg, "v3") of a spreadsheet (data)
  • Create a copy of another spreadsheet (calculator)
  • Have calculator reference data in "v3" of data.

这可能吗?我找不到以编程方式创建/访问电子表格版本的任何功能.在驱动器服务

Is this possible? I can't find any functions to programatically create/access versions of spreadsheets. In the Drive Service, or Drive Web API.

推荐答案

是的,这是可能的.

步骤:

  • 创建计算器
  • 让计算器使用工作表中的数据,该工作表是从导入范围 v1(或其他任何版本)
  • Create calculator
  • Have calculator use data from a sheet that is an imported range from v1 (or whatever)

脚本编写步骤:

  • 复制计算器(DriveApp)
  • 将v1复制到v3(DriveApp)
  • 打开计算器(SpreadsheetApp)
  • 更改计算器数据中的导入范围功能 表格(SpreadsheetApp)
  • Copy calculator (DriveApp)
  • Copy v1 into v3 (DriveApp)
  • Open calculator (SpreadsheetApp)
  • Change import range function in calculator data sheet (SpreadsheetApp)

这篇关于保存并访问“命名版本"通过GAS的Google表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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