Upload CSV to Google Spreadsheet in a new sheet using C# -
i able add new sheet exisiting google spreadsheet via sheets api using code below. how import csv new sheet ?
//auth code sheets api above line sheetsservice sheetsservice = new sheetsservice(bc_init); string spreadsheetid = "xxxxxx"; string sheetname = datetime.now.tostring(); var addsheetrequest = new addsheetrequest(); addsheetrequest.properties = new sheetproperties(); addsheetrequest.properties.title = sheetname; batchupdatespreadsheetrequest batchupdatespreadsheetrequest = new batchupdatespreadsheetrequest(); batchupdatespreadsheetrequest.requests = new list<request>(); batchupdatespreadsheetrequest.requests.add(new request { addsheet = addsheetrequest }); var batchupdaterequest = sheetsservice.spreadsheets.batchupdate(batchupdatespreadsheetrequest, spreadsheetid); batchupdaterequest.execute();
Comments
Post a Comment