tony_angelopoulos
asked on
Download a spreadsheet from Google Docs using C#
I am trying to download a google spreadsheet as an xls. I cannot figure out how to do the export.
I have seen this in the documentation:
http://code.google.com/apis/documents/docs/2.0/developers_guide_protocol.html#DownloadingSpreadsheets
but cannot figure out how to make it happen. Do I need to do something with System.Net.WebClient.Downl oadFile?
I have seen this in the documentation:
http://code.google.com/apis/documents/docs/2.0/developers_guide_protocol.html#DownloadingSpreadsheets
but cannot figure out how to make it happen. Do I need to do something with System.Net.WebClient.Downl
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.GData.Spreadsheets;
using System.Web;
namespace GoogleDownloaderSpreadsheet
{
class Program
{
static void Main(string[] args)
{
SpreadsheetsService myService = new SpreadsheetsService("exampleCo-exampleApp-1");
myService.setUserCredentials("myemail@gmail.com", "mypassword");
SpreadsheetQuery query = new SpreadsheetQuery();
SpreadsheetFeed feed = myService.Query(query);
foreach (SpreadsheetEntry entry in feed.Entries)
{
Console.WriteLine(entry.Title.Text);
if (entry.Title.Text == "Certificates")
{
//how do I export the entry to a location on my hard drive?
}
}
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly what I needed, thank you!
GET http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=spreadsheet_id&fmcmd=4
Open in new window