Name
workbook.ChangeFileAccess(Mode, [WritePassword], [Notify])
Synopsis
Changes a workbook to read-only or read/write access.
|
Argument |
Settings |
|---|---|
|
|
|
|
|
The password required for write access if the workbook is write-protected. |
|
|
True displays a message if the file is not available for read/write access, perhaps because it is open for another user; False does not notify. Default is True. |
Switching a read-only workbook to read/write may reload the file in Excel. The following code demonstrates changing file-access modes on the current workbook:
' Save changes. ThisWorkbook.Save ' Change to read-only. ThisWorkbook.ChangeFileAccess xlReadOnly ' Change back. (May reload file.) ThisWorkbook.ChangeFileAccess xlReadWrite
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access