Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google sheets 如何在不使用批处理的情况下,使用Sheets API将单个单元格添加到Google电子表格中?_Google Sheets_Google Spreadsheet Api - Fatal编程技术网

Google sheets 如何在不使用批处理的情况下,使用Sheets API将单个单元格添加到Google电子表格中?

Google sheets 如何在不使用批处理的情况下,使用Sheets API将单个单元格添加到Google电子表格中?,google-sheets,google-spreadsheet-api,Google Sheets,Google Spreadsheet Api,两年半前有人问了一个问题,但没有回答 我已经研究了使用批更新修改单元格和添加单元格。然而,我试图在不使用批处理机制的情况下添加一个单元格,而且似乎没有记录在案的方法 这是我试过的。请注意,我尝试添加的条目当前没有值,这就是链接文档不允许我“更改”单元格内容的原因。特别是,CellFeed并不包含我试图添加到的值中的单元格 CellEntry otherEntryFromCellFeed = // Obtained through OAuth and then finding a sheet

两年半前有人问了一个问题,但没有回答

我已经研究了使用批更新修改单元格和添加单元格。然而,我试图在不使用批处理机制的情况下添加一个单元格,而且似乎没有记录在案的方法

这是我试过的。请注意,我尝试添加的条目当前没有值,这就是链接文档不允许我“更改”单元格内容的原因。特别是,
CellFeed
并不包含我试图添加到的值中的单元格

   CellEntry otherEntryFromCellFeed = // Obtained through OAuth and then finding a sheet, a worksheet, and a cellFeed, documented above

   CellEntry cellEntry = new CellEntry(5, 10, "Value");
   cellEntry.setService(otherEntryFromCellFeed.getService());
   cellEntry.update();
错误:

Exception in thread "main" java.lang.UnsupportedOperationException: 
Entry cannot be updated at  
com.google.gdata.data.BaseEntry.update(BaseEntry.java:635)

在又一个小时的Javadocs搜索之后,最终我发现
insert
方法也适用于cell提要,它使用了来自未完成文档的
cellFeedUrl

   CellEntry cellEntry = new CellEntry(5, 10, "Value");
   service.insert(cellFeedUrl, cellEntry);