I am running into the same issue where you cannot add rows unless a header is defined, because normally you're specifying a value to add to a row for that column.. and google doesn't know what column you're talking about if it doesn't have any.. so the error makes sense, but not explaining how to add headers automatically is annoying.
I just found http://stackoverflow.com/questions/4348610/how-do-i-create-the-first-line-in-a-new-google-spreadsheet-using-the-api which looks like it answers your question. It is possible, but you must use CellQuery. The problem I am having is that I am not using a key at all and so I have no idea how to get a cellQuery without a key.. One of the cellquery constructors shows that you can use a "string baseUri" but what is the base Uri? How do I get that from my spreadsheet object? My spreadsheet object has 3 or more Uri objects.. On Thursday, August 23, 2012 11:42:37 AM UTC-5, Paracha wrote: > > The question is this is doable? I mean to insert rows into empty/blank > spreadsheet? can someone from google team answer this. This seems to be a > limitation that you first need to add header row manually to be able to > insert data into it. > > On Sunday, July 22, 2012 12:43:41 PM UTC+3, alex wrote: >> >> Why not use Docs List API (or GDrive for that matter) to create (or >> upload) a blank spreadsheet with only first row (read "header") in it? >> >> You could then use Spreadsheets List feed to do batch rows insert w/o >> worrying how many blank rows you have left. >> > -- You received this message because you are subscribed to the Google Groups "Google Spreadsheets API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
