This operation is not supported for this document – Sheets API

Tags: , ,

(<class ‘googleapiclient.errors.HttpError’>, <HttpError 400 when requesting returned “This operation is not supported for this document”>, <traceback object at 0x7fbb3dc3bec0>)

I am getting this error message when accessing a spreadsheet in Google Sheets, I know that the error occurs because it is hosted on the google drive and is in xlsx format. Does anyone know any alternative to performing this conversion from xlsx to gsheet directly in the code?


Yes, you can convert an .xlsx to Google Sheets

For this, use the method Drive v2 method Files: Copy specifying convert true.


service.files().copy(fileId=file_id,convert=true, body={"title": "specifyName"}).execute()

Source: stackoverflow