简体   繁体   中英

google drive spreadsheet error reading worksheet

I try to read a specific worksheet from a spreadsheet. Including 5 worksheets and 4 of them I have no problem with, but the one I want to read gives this error:

Exception:Thrown: "Parsing failed" (Google.GData.Client.ClientFeedException) A Google.GData.Client.ClientFeedException was thrown: "Parsing failed"

code:

            SpreadsheetQuery query = new SpreadsheetQuery();
            SpreadsheetFeed feed = myService.Query(query);

            var campaign = (from x in feed.Entries where x.Title.Text.Contains("my doc") select x).First();

            AtomLink link = campaign.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null);
            WorksheetQuery query2 = new WorksheetQuery(link.HRef.ToString());
            WorksheetFeed feed2 = myService.Query(query2);

            var campaignSheet = feed2.Entries.ElementAt(1); //First();   //0,2,3,4 here works

            try
            {
                AtomLink cellFeedLink = campaignSheet.Links.FindService(GDataSpreadsheetsNameTable.CellRel, null);
                CellQuery query3 = new CellQuery(cellFeedLink.HRef.ToString());
                CellFeed feed3 = myService.Query(query3);    **//Exception HERE**

I had same exception and in my case it was cause by our proxy server. I had possibility to use different proxy server and the same code worked fine. If you are behind a proxy server, you can try to specify proxy server in your SpreadsheetsService ( service.SpreadsheetsService.Proxy).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM