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
isValidSigned()@deprecated. Please use the ‘isValidSigned’ property instead. Indicates whether the signature of VBA project is valid or not.
getCertRawData()@deprecated. Please use the ‘certRawData’ property instead. Gets certificate raw data if this VBA project is signed.
getEncoding()@deprecated. Please use the ’encoding’ property instead. Gets and sets the encoding of VBA project.
setEncoding(EncodingType)@deprecated. Please use the ’encoding’ property instead. Gets and sets the encoding of VBA project.
getName()@deprecated. Please use the ’name’ property instead. Gets and sets the name of the VBA project.
setName(string)@deprecated. Please use the ’name’ property instead. Gets and sets the name of the VBA project.
isSigned()@deprecated. Please use the ‘isSigned’ property instead. Indicates whether VBAcode is signed or not.
isProtected()@deprecated. Please use the ‘isProtected’ property instead. Indicates whether this VBA project is protected.
getIslockedForViewing()@deprecated. Please use the ‘islockedForViewing’ property instead. Indicates whether this VBA project is locked for viewing.
getModules()@deprecated. Please use the ‘modules’ property instead. Gets all VbaModule objects.
getReferences()@deprecated. Please use the ‘references’ property instead. Gets all references of VBA project.
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.
isNull()Checks whether the implementation object is null.

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;

isValidSigned()

@deprecated. Please use the ‘isValidSigned’ property instead. Indicates whether the signature of VBA project is valid or not.

isValidSigned() : boolean;

getCertRawData()

@deprecated. Please use the ‘certRawData’ property instead. Gets certificate raw data if this VBA project is signed.

getCertRawData() : Uint8Array;

getEncoding()

@deprecated. Please use the ’encoding’ property instead. Gets and sets the encoding of VBA project.

getEncoding() : EncodingType;

Returns

EncodingType

setEncoding(EncodingType)

@deprecated. Please use the ’encoding’ property instead. Gets and sets the encoding of VBA project.

setEncoding(value: EncodingType) : void;

Parameters:

ParameterTypeDescription
valueEncodingTypeThe value to set.

getName()

@deprecated. Please use the ’name’ property instead. Gets and sets the name of the VBA project.

getName() : string;

setName(string)

@deprecated. Please use the ’name’ property instead. Gets and sets the name of the VBA project.

setName(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

isSigned()

@deprecated. Please use the ‘isSigned’ property instead. Indicates whether VBAcode is signed or not.

isSigned() : boolean;

isProtected()

@deprecated. Please use the ‘isProtected’ property instead. Indicates whether this VBA project is protected.

isProtected() : boolean;

getIslockedForViewing()

@deprecated. Please use the ‘islockedForViewing’ property instead. Indicates whether this VBA project is locked for viewing.

getIslockedForViewing() : boolean;

getModules()

@deprecated. Please use the ‘modules’ property instead. Gets all VbaModule objects.

getModules() : VbaModuleCollection;

Returns

VbaModuleCollection

getReferences()

@deprecated. Please use the ‘references’ property instead. Gets all references of VBA project.

getReferences() : VbaProjectReferenceCollection;

Returns

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

isNull()

Checks whether the implementation object is null.

isNull() : boolean;