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. |
| isLockedForView | boolean | Readonly. Indicates whether this VBA project is locked for view. If true,the codes could not be visible. |
| islockedForViewing | boolean | Readonly. Indicates whether this VBA project is locked for view. |
| modules | VbaModuleCollection | Readonly. Gets all VbaModule objects. |
| references | VbaProjectReferenceCollection | Readonly. Gets all references of VBA project. |
Methods
| Method | Description |
|---|---|
| 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. |
| isLockedForView() | @deprecated. Please use the ‘isLockedForView’ property instead. Indicates whether this VBA project is locked for view. If true,the codes could not be visible. |
| getIslockedForViewing() | @deprecated. Please use the ‘islockedForViewing’ property instead. Indicates whether this VBA project is locked for view. |
| 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;
isLockedForView
Readonly. Indicates whether this VBA project is locked for view. If true,the codes could not be visible.
isLockedForView : boolean;
islockedForViewing
Readonly. Indicates whether this VBA project is locked for view.
islockedForViewing : boolean;
Remarks
NOTE: This member is now obsolete. Instead, please use VbaProject.IsLockedForView property. This property will be removed 12 months later since July 2026. Aspose apologizes for any inconvenience you may have experienced.
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
setEncoding(EncodingType)
@deprecated. Please use the ’encoding’ property instead. Gets and sets the encoding of VBA project.
setEncoding(value: EncodingType) : void;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | EncodingType | The 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:
| Parameter | Type | Description |
|---|---|---|
| value | string | The 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;
isLockedForView()
@deprecated. Please use the ‘isLockedForView’ property instead. Indicates whether this VBA project is locked for view. If true,the codes could not be visible.
isLockedForView() : boolean;
getIslockedForViewing()
@deprecated. Please use the ‘islockedForViewing’ property instead. Indicates whether this VBA project is locked for view.
getIslockedForViewing() : boolean;
Remarks
NOTE: This member is now obsolete. Instead, please use VbaProject.IsLockedForView property. This property will be removed 12 months later since July 2026. Aspose apologizes for any inconvenience you may have experienced.
getModules()
@deprecated. Please use the ‘modules’ property instead. Gets all VbaModule objects.
getModules() : VbaModuleCollection;
Returns
getReferences()
@deprecated. Please use the ‘references’ property instead. Gets all references of VBA project.
getReferences() : VbaProjectReferenceCollection;
Returns
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
isNull()
Checks whether the implementation object is null.
isNull() : boolean;