Workbook.ChangeFileAccess method (Excel)
Changes the access permissions for the workbook. This may require an updated version to be loaded from the disk.
Syntax
expression.ChangeFileAccess (Mode, WritePassword, Notify)
expression A variable that represents a Workbook object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Mode | Required | XlFileAccess | Specifies the new access mode. |
WritePassword | Optional | Variant | Specifies the write-reserved password if the file is write reserved and Mode is xlReadWrite. Ignored if there's no password for the file or if Mode is xlReadOnly. |
Notify | Optional | Variant | True (or omitted) to notify the user if the file cannot be immediately accessed. |
Remarks
If you have a file open in read-only mode, you don't have exclusive access to the file. If you change a file from read-only to read/write, Microsoft Excel must load a new copy of the file to ensure that no changes were made while you had the file open as read-only.
Example
This example sets the active workbook to read-only.
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기