I'm using the following code to add a new tab to my spreadsheet:
$newSheetTitie = date("m/d/Y");
$body = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(array(
'requests' => array('addSheet' => array('properties' => array('title' => $newSheetTitie )))));
$result = $service->spreadsheets->batchUpdate($spreadsheet_id,$body);
This works well, but is there currently any way of adding the new sheet to the beginning of file (prepend it to the other tabs)?
Thanks
How about this modification? When you want to add the new sheet to the 1st tab, please use the property of index
as follows. The 1st tab is 0
.
$body = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(array('requests' => array('addSheet' => array('properties' => array('title' => $newSheetTitie )))));
To:$body = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(array('requests' => array('addSheet' => array('properties' => array('title' => $newSheetTitie, 'index' => 0)))));