xlwings / xlwings

xlwings is a Python library that makes it easy to call Python from Excel and vice versa. It works with Excel on Windows and macOS as well as with Google Sheets and Excel on the web.
https://www.xlwings.org
Other
3k stars 503 forks source link

xlwings.xlam is corrupted #2541

Closed MogensBLaursen closed 4 weeks ago

MogensBLaursen commented 1 month ago

OS (e.g. Windows 10 or macOS Sierra)

Windows 11 Business 23 H2 OS-build 22631.4317

Versions of xlwings, Excel and Python (e.g. 0.11.8, Office 365, Python 3.7)

xlwings 0.33.2, Excel Office 365, Python 3.12.4 (Anaconda distribution)

Describe your issue (incl. Traceback!)

After installing the add-in using "xlwings addin install", I am met with the message box "Excel cannot open the file 'xlwings.xlam' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file".

I have reinstalled Anaconda, created new conda environments, performed an Office365 repair, but all to no avail.

Apparently, Excel removes the .xlam file, as it no longer resides in the XLSTART-folder

Running "xlwings addin status " returns "The add-in is not installed"

When trying a re-install "xlwings addin install" the error "FileNotFoundError(2, 'No such file or directory')" is returned.

# Your traceback here
Not applicable as the problem occurs outside of python

Include a minimal code sample to reproduce the issue (and attach a sample workbook if required!)

# Your code here
Not applicable as the problem occurs outside of python
fzumstein commented 1 month ago

Most likely an antivirus/windows defender issue. You would need to restore the file from the antivirus menu.

MogensBLaursen commented 4 weeks ago

Thanks for the swift reply ! Yes, the file appeared in the Windows Defender log, but I found no option to release it. My workaround was to copy the xlwings... dll from version 0.31.4 (from the base environment) into the XLSTART-folder, and it seems to work well. Also, I installed a new pc, where Anaconda gave me the 0.31.4 version and it also installed smoothly. I had issued a "conda update xlwings" prior to the problem, and it gave me the xlwings version 0.33.2. So maybe the conda update broke the installation.