将Google Apps Script中已弃用的UiApp迁移至HtmlService求助
求助:将Google Apps Script的UiApp代码迁移到HtmlService
我不是专业程序员,表述有问题的地方请见谅。我在网上找到一段用于Google Sheets数据录入的Google Apps Script代码,但原代码使用了已被弃用的UiApp。我一直在网上查找将其迁移至HtmlService的方法却无果,希望能得到帮助!
以下是相关代码片段:
function doGet() { var sheet = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1J_Fi7-hJuZkA2UftqM1Q-SG5NWxdQZkhLGjLIlVowTc/edit?usp=sharing'); //要操作的表格链接 var app = UiApp.createApplication(); //创建应用 var ss = sheet.getSheets()[0]; //获取表格中的第一个工作表 var myPanel = app.createVerticalPanel(); //创建垂直面板 var scroll = app.createScrollPanel().setPixelSize(200, 600); //创建指定尺寸的滚动面板 var panel3 = app.createVerticalPanel(); //创建垂直面板 var panel4 = app.createVerticalPanel(); //创建垂直面板 var panel = app.createVerticalPanel(); //创建垂直面板 var panel2 = app.createAbsolutePanel().setSize('100%','100%').setId('absPanel'); //创建覆盖整个应用的绝对面板 var periodKey = sheet.getSheetByName('Periods');//获取名为Periods的工作表 var periodKeyValues = periodKey.getDataRange().getValues();//获取该工作表中的所有数据 var guildKey = sheet.getSheetByName('Guilds');//获取名为Guilds的工作表 var guildKeyValues = guildKey.getDataRange().getValues();//获取该工作表中的所有数据 }
内容的提问来源于stack exchange,提问作者Andre Nobrega
相关产品推荐
相关产品推荐

