有没有一种方法可以在一次致电Google中获得所有图纸值,功能和样式等?
我发现做到这一点的唯一方法是针对有效范围分别调用每种样式。
如果可能的话,我想一次性获得工作表的所有数据/公式/样式等。
var sheet = SpreadsheetApp.getActiveSheet();
var activeRange = sheet.getActiveRange();
var backgrounds = activeRange.getBackgrounds();
var fontSizes = activeRange.getFontSizes();
var colours = activeRange.getFontColors();
var alignments = activeRange.getHorizontalAlignments();
var values = activeRange.getValues();
var formulas = activeRange.getFormulas();
var vAlignments = activeRange.getVerticalAlignments();
您可以使用Advanced Sheet Service来获取完整的电子表格数据,如下所示:
var ssID = "[YOUR_SPREADSHEET_ID]";
var fields = "developerMetadata,namedRanges,properties,sheets,spreadsheetId,spreadsheetUrl";
var fullSpreadsheetData = Sheets.Spreadsheets.get(ssId, {"fields":fields});
调用会Sheets.Spreadsheets.get(...)
返回Sheets API定义的Spreadsheet Resource对象。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句