-
-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xlwings returning incorrect filepath than input file specified #2410
Comments
Further context: I have found a fix by using xw.books.open(filepath) which does the trick only when the file is CLOSED. If the file is open on running the script, the filepath returned is incorrect. |
Can you give an example of the provided filepath and the one it tries to open? You may have to configure SharePoint/OneDrive according to this here: https://docs.xlwings.org/en/latest/onedrive_sharepoint.html |
As an example, this will be the input file: filepath = r'C:\Users\HasinaTalukdar\Comp Name\Customer Submitted Data - Documents\14. Granularity Review\Phase 9\TEST.xlsx' wb = xw.Book(filepath) will be called in this function: def get_risk_codes(filepath,input_tab_name): ... and this error message is returned: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\HasinaTalukdar\Comp Name\Data Operations - Documents\1. Archive\Historic Files\2. Data Journey - Failed Copy -KEEP\Rematching\Changes\DTS 1.3 Data remediation\Archive\Database Upload Files\For Shadow List - July 2020' |
thanks, is this on SharePoint? |
OS (e.g. Windows 10 or macOS Sierra)
Windows 10
Versions of xlwings, Excel and Python (e.g. 0.11.8, Office 365, Python 3.7)
Python 3.11.4
xlwings 0.30.15
Describe your issue (incl. Traceback!)
When using the command
wb = xw.Book(filepath)
the filepath returned is not the one I have assigned to the variable filepath.
Even when passing in the full filepath (instead of assigning to the variable filepath), I receive an error with the script seemingly attempting to access a non-existent file (this 'other' file sits in another location and has previosly been deleted.
The text was updated successfully, but these errors were encountered: