VbaProject

VbaProject class

Represents the VBA project.

Properties

NameTypeDescription
IsValidSignedbooleanIndicates whether the signature of VBA project is valid or not.
CertRawDatabyte[]Gets certificate raw data if this VBA project is signed.
EncodingEncodingGets and sets the encoding of VBA project.
NameStringGets and sets the name of the VBA project.
IsSignedbooleanIndicates whether VBAcode is signed or not.
IsProtectedbooleanIndicates whether this VBA project is protected.
IslockedForViewingbooleanIndicates whether this VBA project is locked for viewing.
ModulesVbaModuleCollectionGets all VbaModule objects.
ReferencesVbaProjectReferenceCollectionGets all references of VBA project.

Methods

NameDescription
signSign this VBA project by a DigitalSignature
protectProtects or unprotects this VBA project.

If islockedForViewing is true, the password could not be null. | | copy | Copy VBA project from other file. | | validatePassword | Validates protection password. |

VbaProject.IsValidSigned property

Indicates whether the signature of VBA project is valid or not.

Type: boolean

VbaProject.CertRawData property

Gets certificate raw data if this VBA project is signed.

Type: byte[]

VbaProject.Encoding property

Gets and sets the encoding of VBA project.

Type: Encoding

VbaProject.Name property

Gets and sets the name of the VBA project.

Type: String

VbaProject.IsSigned property

Indicates whether VBAcode is signed or not.

Type: boolean

VbaProject.IsProtected property

Indicates whether this VBA project is protected.

Type: boolean

VbaProject.IslockedForViewing property

Indicates whether this VBA project is locked for viewing.

Type: boolean

VbaProject.Modules property

Gets all VbaModule objects.

Type: VbaModuleCollection

VbaProject.References property

Gets all references of VBA project.

Type: VbaProjectReferenceCollection

sign(digitalSignature)

Sign this VBA project by a DigitalSignature

ParameterTypeDescription
digitalSignatureDigitalSignatureDigitalSignature

protect(islockedForViewing, password)

Protects or unprotects this VBA project.

If islockedForViewing is true, the password could not be null.

ParameterTypeDescription
islockedForViewingbooleanindicates whether locks project for viewing.
passwordStringIf the value is null, unprotects this VBA project, otherwise projects the this VBA project.

copy(source)

Copy VBA project from other file.

ParameterTypeDescription
sourceVbaProject

validatePassword(password)

Validates protection password.

ParameterTypeDescription
passwordStringthe password

Returns: Whether password is the protection password of this VBA project