I am working on accessing the google spreadsheet. I was able to read the data from google spread using C# code.I was able to get the collection of values with in the given range of spreadsheet. I was researched on this cell address but i didn't find the solution.
My Requirement is i want to get the cell value and corresponding cell address.
How can I do it? I was stuck with this from past few days.Please help me out from this issue.
Thanks in advance!
Here is my code :
string applicationName = "*******";
var serviceaccountemail = "*******@*************.iam.gserviceaccount.com";
var certificate = new X509Certificate2(GetCertificateBytes(), "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceaccountemail)
{
Scopes = new[] { "https://spreadsheets.google.com/feeds" }
}.FromCertificate(certificate));
var service = new SheetsService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = applicationName,
});
String spreadsheetId = "1mPir8cyjHBlSYjS4ROsyZBX7DocJlyATQdg58cLhmOI";
String range = "Sheet1!A1:H";
SpreadsheetsResource.ValuesResource.GetRequest request =
service.Spreadsheets.Values.Get(spreadsheetId, range);
ValueRange response = request.Execute();
IList<IList<Object>> values = response.Values;