[Python] How convert an .xlsx to Google Sheets format

Discussão em 'Python' iniciado por Stack, Junho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to convert an Excel file like Excel.xlsx to Google-Sheets.

    I tried to read it like a normal spreadsheet but it didn't work, see error below

    import gspread
    from google.auth import default
    creds, _ = default()

    from oauth2client.client import GoogleCredentials
    import pandas as pd
    gc = gspread.authorize(creds)


    woorkbook = gc.open_by_url('https://docs.google.com/spreadsheets/d/19vWu-OSjAKSvfh8FgvZClk4aGsGxx5ej/edit#gid=198588977')
    sheet = woorkbook.get_worksheet(0)
    list_of_lists = sheet.get_all_values()


    ---------------------------------------------------------------------------
    APIError: {'code': 400, 'message': 'This operation is not supported for this document', 'status': 'FAILED_PRECONDITION'}

    How can I do that?

    Continue reading...

Compartilhe esta Página