The user has declined permission error when trying to use xlwings library to read XL files

I am trying to run the following code in Cursor in Jupyter notebook and I get an error about invalid permission

import xlwings as xw
wb = xw.Book("input/temp.xlsx")

When I run the same code in VS Code, it works. When I checked in the forums of Xlwings, they say that the application (here Cursor) has not implemented it properly - here is the link to the post - python - OSERROR: -1743 MESSAGE: The user has declined permission - Stack Overflow

Can you please check whether it is a bug and fix it - when I run the code, I get a pop asking for permission to allow Cursor to access file and I said yes. But I still get the error.

You can reproduce the error above using any XL file.

any update on this, please?

I have the same problem. There comes no OS dialog up to allow the action and there is no setting found for Cursor IDE in system settings (but for Visual Studio Code it’s there)

I managed to workaround this issue by opening Cursor from a terminal window:
open /Applications/Cursor.app/contents/MacOS/Cursor

1 Like