VbaProject
VbaProject class
Represents the VBA project.
class VbaProject;
Properties
| Property | Type | Description |
|---|---|---|
| isValidSigned | boolean | Readonly. Indicates whether the signature of VBA project is valid or not. |
| certRawData | Uint8Array | Readonly. Gets certificate raw data if this VBA project is signed. |
| encoding | EncodingType | Gets and sets the encoding of VBA project. |
| name | string | Gets and sets the name of the VBA project. |
| isSigned | boolean | Readonly. Indicates whether VBAcode is signed or not. |
| isProtected | boolean | Readonly. Indicates whether this VBA project is protected. |
| islockedForViewing | boolean | Readonly. Indicates whether this VBA project is locked for viewing. |
| modules | VbaModuleCollection | Readonly. Gets all VbaModule objects. |
| references | VbaProjectReferenceCollection | Readonly. Gets all references of VBA project. |
Methods
| Method | Description |
|---|---|
| sign(DigitalSignature) | Sign this VBA project by a DigitalSignature |
| protect(boolean, string) | Protects or unprotects this VBA project. |
| copy(VbaProject) | Copy VBA project from other file. |
| validatePassword(string) | Validates protection password. |
isValidSigned
Readonly. Indicates whether the signature of VBA project is valid or not.
isValidSigned : boolean;
certRawData
Readonly. Gets certificate raw data if this VBA project is signed.
certRawData : Uint8Array;
encoding
Gets and sets the encoding of VBA project.
encoding : EncodingType;
name
Gets and sets the name of the VBA project.
name : string;
isSigned
Readonly. Indicates whether VBAcode is signed or not.
isSigned : boolean;
isProtected
Readonly. Indicates whether this VBA project is protected.
isProtected : boolean;
islockedForViewing
Readonly. Indicates whether this VBA project is locked for viewing.
islockedForViewing : boolean;
modules
Readonly. Gets all VbaModule objects.
modules : VbaModuleCollection;
references
Readonly. Gets all references of VBA project.
references : VbaProjectReferenceCollection;
sign(DigitalSignature)
Sign this VBA project by a DigitalSignature
sign(digitalSignature: DigitalSignature) : void;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| digitalSignature | DigitalSignature | DigitalSignature |
protect(boolean, string)
Protects or unprotects this VBA project.
protect(islockedForViewing: boolean, password: string) : void;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| islockedForViewing | boolean | indicates whether locks project for viewing. |
| password | string | If the value is null, unprotects this VBA project, otherwise projects the this VBA project. |
Remarks
If islockedForViewing is true, the password could not be null.
copy(VbaProject)
Copy VBA project from other file.
copy(source: VbaProject) : void;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| source | VbaProject |
validatePassword(string)
Validates protection password.
validatePassword(password: string) : boolean;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| password | string | the password |
Returns
Whether password is the protection password of this VBA project