'Error trying to write a row in google sheets using API v4

I'm trying to write a row to a sheet using java and Google Sheets API v4. I'm getting an error that I just can't understand. Any help would be greatly appreciated!

The values passed are:

sRange = '09/03/2017 11:01:13 PM'!A1
body = {majorDimension=ROWS, values=[[Test ID, Test Name, Run ID, Status, Run Duration, Execution Date, Execution Time]]}

Here is the trouble code:

outputValues = Arrays.asList(Arrays.asList("Test ID", "Test Name", "Run ID", "Status", "Run Duration", "Execution Date", "Execution Time"));
sRange = "'" + sSheetName + "'" + "!" + sHeaderRow;
body = new ValueRange().setValues(outputValues).setMajorDimension("ROWS");
result = service.spreadsheets().values().update(sSpreadsheetID, sRange, body).setValueInputOption("RAW").execute();

And the result:

{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Requested writing within range ['09/03/2017 11:01:13 PM'!A1], but tried writing to column [B]",
    "reason" : "badRequest"
  } ],
  "message" : "Requested writing within range ['09/03/2017 11:01:13 PM'!A1], but tried writing to column [B]",
  "status" : "INVALID_ARGUMENT"
}


Solution 1:[1]

Got this error due to character issues in the sheet title. Removing spaces, dashes, and colons in the sheet titles and replacing them with underscores fixed it.

Solution 2:[2]

I have been on this for some time now, in my case i was trying to update more than 2 fields in a row and i specified range as A1:B1 this only depicts 2 rows to be updated. I changed it to just A1 and it worked.

So let your range be:

SheetName!A1

Solution 3:[3]

Change your Sheet name to some simple version of it (without special symbols). Helped in my case.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 olawalejuwonm
Solution 3 Jerry McQuin