[Python] Cannot open Excel files in python edited on Excel Web

Discussão em 'Python' iniciado por Stack, Março 13, 2025.

  1. Stack

    Stack Membro Participativo

    I'm encountering issues when trying to open locally Excel files that were edited on SharePoint via the web Excel interface and then downloaded. Specifically, I'm using pandas on Linux/Windows and running into the following errors:

    xlrd engine:

    XLRDError: Can't find workbook in OLE2 compound document


    openpyxl engine:

    BadZipFile: File is not a zip file


    Interestingly, I can open these files without any issues in Excel or using xlsxwings. However, I need to be able to open and process these files on a Linux system without having Excel installed.

    Additional details: Editing the files via the SharePoint desktop app does not introduce this error; it only occurs with the web version. Turning sheet protection on/off does not change anything. I've tested several versions of the relevant libraries but the issue persists. Has anyone encountered a similar problem or have any suggestions on how to resolve this?

    Continue reading...

Compartilhe esta Página