Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I am facing too much problem to export data to a Google Sheets file. using Google.GData.API.

Thanks in advance.
Posted
Comments
Arkadeep De 18-Jul-15 3:06am    
can you please improve your solution with your code and where you are getting error..
ashok rathore 29-Jul-15 9:27am    
var requestFactory =
new GOAuth2RequestFactory(null, "MySpreadsheetIntegration-v1", parameters);
var service = new SpreadsheetsService("MySpreadsheetIntegration-v1") {RequestFactory = requestFactory};

//SpreadsheetsService service = new SpreadsheetsService("MySpreadsheetIntegration-v1");

// TODO: Authorize the service object for a specific user (see other sections)

// Instantiate a SpreadsheetQuery object to retrieve spreadsheets.
var query = new SpreadsheetQuery();

// Make a request to the API and get all spreadsheets.
var feed = service.Query(query);

// TODO: Choose a spreadsheet more intelligently based on your
// app's needs.
var spreadsheet = (SpreadsheetEntry)feed.Entries[0];

// Create a local representation of the new worksheet.
var worksheet = new WorksheetEntry {Title = {Text = "New Worksheet"}, Cols = 10, Rows = 20};

// Send the local representation of the worksheet to the API for
// creation. The URL to use here is the worksheet feed URL of our
// spreadsheet.
var wsFeed = spreadsheet.Worksheets;
service.Insert(wsFeed, worksheet);
ashok rathore 29-Jul-15 9:28am    
I am unable to create google sheet by using this code as well, I have search too much but couldn't get any success.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900