Ask Your Question
1

In Python using XLWINGS, what is the process for obtaining the username that has reserved write access on an Excel file?

asked 2023-06-11 05:33:18 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-06-11 05:41:02 +0000

david gravatar image

To obtain the username that has reserved write access on an Excel file using XLWINGS, you can use the following code:

import xlwings as xw

# Open the Excel file
wb = xw.Book('path/to/excel/file')

# Get the write reservation object
write_reservation = wb.app.WriteReservedBy

# Get the username of the user who has reserved write access
username = write_reservation.Username

This code will open the Excel file, get the write reservation object, and then retrieve the username of the user who has reserved write access. If no user has reserved write access, the Username attribute will be None.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-11 05:33:18 +0000

Seen: 16 times

Last updated: Jun 11 '23