Workbook.ProtectSharingEx Method
Saves the workbook and protects it for sharing.
Namespace: Microsoft.Office.Tools.Excel
Assemblies: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
Syntax
'Declaration
Sub ProtectSharingEx ( _
Filename As Object, _
Password As Object, _
WriteResPassword As Object, _
ReadOnlyRecommended As Object, _
CreateBackup As Object, _
SharingPassword As Object, _
FileFormat As Object _
)
void ProtectSharingEx(
Object Filename,
Object Password,
Object WriteResPassword,
Object ReadOnlyRecommended,
Object CreateBackup,
Object SharingPassword,
Object FileFormat
)
Parameters
Filename
Type: System.ObjectThe name of the saved file. You can include a full path; if you do not, Microsoft Office Excel saves the file in the current folder.
Password
Type: System.ObjectA case-sensitive password for the workbook. If this argument is omitted, you can unprotect the workbook without using a password. Otherwise, you must specify the password to unprotect the workbook.
WriteResPassword
Type: System.ObjectThe write-reservation password for this file. If a file is saved with the password and the password is not supplied when the file is opened, the file is opened read-only.
ReadOnlyRecommended
Type: System.Objecttrue to display a message when the file is opened, recommending that the file be opened read-only.
CreateBackup
Type: System.Objecttrue to create a backup file.
SharingPassword
Type: System.ObjectThe password to be used to protect the file for sharing.
FileFormat
Type: System.ObjectA string that indicates the file format.
Remarks
Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak passwords do not mix these elements. For example, "Y6dh!et5" is a strong password, but "House27" is a weak password. Use a strong password that you can remember so that you do not have to write it down.
Optional Parameters
For information on optional parameters, see Optional Parameters in Office Solutions.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.