Answer the question
In order to leave comments, you need to log in
How to create a new sheet and change its name in Google spreadsheet?
How to use python to create a new sheet and change its name in google spreadsheet?
Answer the question
In order to leave comments, you need to log in
Probably gspread
not a bad solution, but with the advent of the Sheets API v4, things have become a little easier.
spreadsheetId=''
new_sheet_title=''
from googleapiclient.discovery import build
service = build('sheets', 'v4')
requests = []
requests.append({
'addSheet': {
'properties': {
'title': new_sheet_title
}
}
})
body = {
'requests': requests
}
response = service.spreadsheets().batchUpdate(
spreadsheetId=spreadsheetId,
body=body).execute()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question