VbaProject

VbaProject class

Represents the VBA project.

class VbaProject;

Properties

PropertyTypeDescription
isValidSignedbooleanReadonly. Indicates whether the signature of VBA project is valid or not.
certRawDataUint8ArrayReadonly. Gets certificate raw data if this VBA project is signed.
encodingEncodingTypeGets and sets the encoding of VBA project.
namestringGets and sets the name of the VBA project.
isSignedbooleanReadonly. Indicates whether VBAcode is signed or not.
isProtectedbooleanReadonly. Indicates whether this VBA project is protected.
islockedForViewingbooleanReadonly. Indicates whether this VBA project is locked for viewing.
modulesVbaModuleCollectionReadonly. Gets all VbaModule objects.
referencesVbaProjectReferenceCollectionReadonly. Gets all references of VBA project.

Methods

MethodDescription
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:

ParameterTypeDescription
digitalSignatureDigitalSignatureDigitalSignature

protect(boolean, string)

Protects or unprotects this VBA project.

protect(islockedForViewing: boolean, password: string) : void;

Parameters:

ParameterTypeDescription
islockedForViewingbooleanindicates whether locks project for viewing.
passwordstringIf 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:

ParameterTypeDescription
sourceVbaProject

validatePassword(string)

Validates protection password.

validatePassword(password: string) : boolean;

Parameters:

ParameterTypeDescription
passwordstringthe password

Returns

Whether password is the protection password of this VBA project