Google Spreadsheets:在单元格中显示文档URL。可能?

时间:2014-01-14 17:09:37

标签: url google-apps-script google-sheets cell

简单问题:我想在特定单元格中获取活动文档(Google电子表格)的网址。

因此,如果我在https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXXXXXXXXXXX&usp=drive_web#gid=16

A1 中输入 = GetUrl()

应该给我结果 的 https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXXXXXXXXXXX&usp=drive_web#gid=16 在单元格A1

1 个答案:

答案 0 :(得分:1)

这样的功能可能很有用:

function GetUrl() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  return ss.getUrl();
}

enter image description here

检查:Class Spreadsheet - getUrl()