VbaProject class

VbaProject class

Represents the VBA project.

The VbaProject type exposes the following members:

Properties

PropertyDescription
is_valid_signedIndicates whether the signature of VBA project is valid or not.
cert_raw_dataGets certificate raw data if this VBA project is signed.
encodingGets and sets the encoding of VBA project.
nameGets and sets the name of the VBA project.
is_signedIndicates whether VBAcode is signed or not.
is_protectedIndicates whether this VBA project is protected.
islocked_for_viewingIndicates whether this VBA project is locked for viewing.
modulesGets all VbaModule objects.
referencesGets all references of VBA project.

Methods

MethodDescription
sign(self, digital_signature)Sign this VBA project by a DigitalSignature
protect(self, islocked_for_viewing, password)Protects or unprotects this VBA project.
copy(self, source)Copy VBA project from other file.
validate_password(self, password)Validates protection password.

Example

from aspose.cells import Workbook

# Instantiating a Workbook object
workbook = Workbook()
#  Init VBA project.
vbaProject = workbook.vba_project
# Saving the Excel file
workbook.save("book1.xlsm")

See Also