0
如何在電子表格中插入一行? 我嘗試用這個代碼,但有一個錯誤:用Java在Google工作表中插入行
Exception in thread "main" com.google.gdata.util.ServiceException: Method Not Allowed
在行:row = service.insert(url, row);
爲什麼不允許的方法 ???
public class MyClass {
public static void main(String[] args)
throws AuthenticationException, MalformedURLException, IOException, ServiceException
{
SpreadsheetService service = new SpreadsheetService("MyApp");
FeedURLFactory factory = FeedURLFactory.getDefault();
String key = "***my_key***";
URL spreadSheetUrl = factory.getWorksheetFeedUrl(key,"public","full");
WorksheetFeed feed = service.getFeed(spreadSheetUrl, WorksheetFeed.class);
WorksheetEntry worksheet = feed.getEntries().get(13);
URL url = worksheet.getListFeedUrl();
ListEntry row = new ListEntry();
row.getCustomElements().setValueLocal("header", "aaa");
row = service.insert(url, row);
}
}
幫幫我!謝謝
我認爲URL是正確的,如果我試圖獲得這些工作表的信息,我明白了! @大衛梅瑞迪斯 –