Skip to content

SharePoint: SHAREPOINT_WIN issue with xlwings versions after 0.30.13 #2413

@timo-stein

Description

@timo-stein

System: Windows 10

Software versions: xlwings-0.30.14 / xlwings-0.30.15, Office 365 (version 2312), Python 3.12.2

Describe your issue (incl. Traceback!)

Using xlwings-0.30.13 works fine. Version xlwings-0.30.14 and xlwings 0.30.15 will yield the following error message while running xw.Book(self.xlsmpath) with self.xlsmpath being an absolute path:

raceback (most recent call last):
  File "c:\Users\MYUSERNAME\Nexperia\Waste Management - Documents\scripts\regelbestellung.py", line 17, in <module>
    befpap.setPaper(
  File "c:\Users\MYUSERNAME\Nexperia\Waste Management - Documents\scripts\befpap_test.py", line 137, in setPaper
    workbook = xw.Book(self.xlsmpath)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python312\Lib\site-packages\xlwings\main.py", line 919, in __init__
    wb.fullname.lower() == fullname.lower()
    ^^^^^^^^^^^
  File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python312\Lib\site-packages\xlwings\main.py", line 1173, in fullname
    return self.impl.fullname
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python312\Lib\site-packages\xlwings\_xlwindows.py", line 903, in fullname
    return fullname_url_to_local_path(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python312\Lib\site-packages\xlwings\utils.py", line 591, in fullname_url_to_local_path
    return search_local_sharepoint_path(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\MYUSERNAME\AppData\Local\Programs\Python\Python312\Lib\site-packages\xlwings\utils.py", line 752, in search_local_sharepoint_path
    raise xlwings.XlwingsError(
xlwings.XlwingsError: Your SharePoint configuration either requires your workbook name to be unique across all synced SharePoint folders or you need to edit the SHAREPOINT_WIN setting including one or more folder levels, see: xlwings.org/error.

I've tried the following steps to mitigate:

  1. Insert the _xlwings.conf generated from "xlwings quickstart", renamed it to xlwings.conf, inserted a row with SHAREPOINT_WIN (column A) and %USERPROFILE%\MYCOMPANYNAME\SITENAME (column B)
  2. Create a user environment variable SHAREPOINT_WIN : %USERPROFILE%\MYCOMPANYNAME\SITENAME
  3. Create a folder .xlwings below %USERPROFILE% folder, create an xlwings.conf file therein with contents from https://docs.xlwings.org/en/stable/addin.html#user-config-ribbon-config-file, adapting SHAREPOINT_WIN to be %USERPROFILE%\MYCOMPANYNAME\SITENAME

Everything works fine when downgrading to xlwings-0.30.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions