Skip to content
Advertisement

Cannot hide gridlines Google Spreadsheet API PHP

I am trying to hide all gridlines from a file I just created with Google Sheets API, I am using the following code:

JavaScript

But does not hide, instead gives me an error. What I am doing wrong?

Advertisement

Answer

In order to hide the grid line of the Google Spreadsheet with Sheets API, UpdateSheetPropertiesRequest of batchUpdate is used. Unfortunately, updateDimensionProperties cannot achieve this. I think that this is the reason of your issue. In order to achieve your goal, when your script is modified, it becomes as follows.

Modified script:

In this modification, your $requests is modified as follows.

JavaScript

Note:

  • In this modification, it supposes that your $service = $this->GoogleServiceSheets(); and $sheetID are valid values. And also, it supposes that you have already been able to get and put values for Google Spreadsheet using Sheets API. Please be careful this.

Reference:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement