Search code examples
google-sheetsgoogle-sheets-apisymfony-3.2

Blank rows cannot be written; use delete instead - PHP


I'm using Symfony 3.2 (PHP Framework) and Google API for Manage Google Spreadsheet using code.

I use google/apiclient, and asimlqt/php-google-spreadsheet-client library for manage Google Sheets.

As usually, I also created Application in console.developers.google.com.

Everything is working perfectly, but when I add new columns in Google Sheets after that this issue is raised.

I deleted the Application from console.developers.google.com and re-create it also I create new spreadsheet - but same issue again.

I'm following this Document which mentions the issue but not how to fix it.


Solution

  • Yoo, Answer found, I did silly mistake and nothing wrong with the code.

    1) If you're using Google Spreadsheets and it suddenly stopped working, verify that you didn't accidentally insert a blank row anywhere. It interprets a blank row as the end of the spreadsheet.

    2) Deleting existing rows or columns and Resorting the sheet

    3) Make sure that Header name of sheet and Your Array Key (insert object) must be same.

    4) Google Sheets documents does not support column names that begin with a numeral, contain spaces, or contain underscores.

    After Deleting all the Rows and columns, I tried with same code and it is working.