_Workbook.ChangeFileAccess Method
Changes the access permissions for the workbook. This may require an updated version to be loaded from the disk.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Sub ChangeFileAccess ( _
Mode As XlFileAccess, _
WritePassword As Object, _
Notify As Object _
)
'Usage
Dim instance As _Workbook
Dim Mode As XlFileAccess
Dim WritePassword As Object
Dim Notify As Object
instance.ChangeFileAccess(Mode, WritePassword, _
Notify)
void ChangeFileAccess(
XlFileAccess Mode,
Object WritePassword,
Object Notify
)
Parameters
Mode
Type: Microsoft.Office.Interop.Excel.XlFileAccessRequired XlFileAccess. Specifies the new access mode.
WritePassword
Type: System.ObjectOptional Object. 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
Type: System.ObjectOptional Object. 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.