简体   繁体   English

异常:服务电子表格在访问具有 id 的文档时失败

[英]Exception: Service Spreadsheets failed while accessing document with id

Google Script can't access to a spreadsheet created by it, but can open a spreadsheet created by me. Google Script 无法访问它创建的电子表格,但可以打开我创建的电子表格。

This is working (the spreadsheets were created by me):这是有效的(电子表格是由我创建的):

var DataBookID = MasterSheet.getRange("B4:G5").getValue();   
var Data = SpreadsheetApp.openById(DataBookID);

This is not working (spreadSheet duplicated via google script):这不起作用(通过谷歌脚本复制了 spreadSheet):

var WorkingBook = SpreadsheetApp.openById(DuplicateID);

The error I received: Error我收到的错误:错误
Exception: Service Spreadsheets failed while accessing document with id -----Spreadsheet ID------.异常:服务电子表格在访问 ID 为 ----- 电子表格 ID ------ 的文档时失败。

The duplicate method:复制方法:

//DUPLICATE TEMPLATE
var destFolder = DriveApp.getFolderById(DestFolderID);
DriveApp.getFileById(TemplateID).makeCopy(BookName, destFolder);

EDIT: If I try this, it gives me the same error:编辑:如果我尝试这样做,它会给我同样的错误:

var testing = DriveApp.getFileById(TemplateID).makeCopy(BookName, destFolder);
SpreadsheetApp.open(testing).getRange("A8").setValue("AAAAAA");

I don't know why it gives me this error.我不知道为什么它会给我这个错误。 Thanks in advance.提前致谢。

SOLVED, just I have to save the template file as a google spreadsheet document (it was xlsx) and now works.已解决,只是我必须将模板文件保存为谷歌电子表格文档(它是 xlsx),现在可以使用了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 例外:访问带有 id google sheet 的文档时服务电子表格失败 - Exception: Service Spreadsheets failed while accessing document with id google sheet 例外:我认为访问带有 id *** / getsheetname() 错误的文档时服务电子表格失败 - Exception: Service Spreadsheets failed while accessing document with id *** / getsheetname()error I think 服务电子表格在访问 ID 为 xxx 的文档时失败 - Service Spreadsheets failed while accessing document with ID xxx 异常:服务电子表格在访问 ID 为 XXX 的文档时超时 - Exception: Service Spreadsheets timed out while accessing document with id XXX 电子邮件中的地理图表 | 访问具有 ID 的文档时服务电子表格失败 | 谷歌表格 - Geo Charts in Emails | Service Spreadsheets failed while accessing document with id | Google Sheets 错误异常:访问具有 ID 的文档时服务电子表格失败 - Error Exception: Service Spreadsheet failed while accessing document with id 错误消息:访问 ID 为 1HjEecpeXGdR3iF_0W6CdLIm-hE-W9tbuxmvtKlte1OY 的文档时服务电子表格失败 - Error Msg: Service Spreadsheets failed while accessing document with id 1HjEecpeXGdR3iF_0W6CdLIm-hE-W9tbuxmvtKlte1OY Google Sheet 错误:访问带有 id 的文档时服务电子表格超时 - Google Sheet Error: Service Spreadsheets timed out while accessing document with id “访问时服务电子表格失败”(看似)简单的代码 - “Service Spreadsheets failed while accessing” on (seemingly) simple code DocumentApp 服务抛出“服务文档在访问带有 id 的文档时失败”错误 - DocumentApp service throws a “Service Documents failed while accessing document with id” error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM