Aspose::Cells::Vba::VbaProject class

VbaProject class

Represents the VBA project.

class VbaProject

Methods

MethodDescription
Copy(const VbaProject& source)Copy VBA project from other file.
GetCertRawData()Gets certificate raw data if this VBA project is signed.
GetEncoding()Gets and sets the encoding of VBA project.
GetIslockedForViewing()Indicates whether this VBA project is locked for viewing.
GetModules()Gets all VbaModule objects.
GetName()Gets and sets the name of the VBA project.
GetReferences()Gets all references of VBA project.
IsNull() constChecks whether the implementation object is nullptr.
IsProtected()Indicates whether this VBA project is protected.
IsSigned()Indicates whether VBAcode is signed or not.
IsValidSigned()Indicates whether the signature of VBA project is valid or not.
explicit operator bool() constoperator bool()
operator=(const VbaProject& src)operator=
Protect(bool islockedForViewing, const U16String& password)Protects or unprotects this VBA project.
Protect(bool islockedForViewing, const char16_t* password)Protects or unprotects this VBA project.
SetEncoding(EncodingType value)Gets and sets the encoding of VBA project.
SetName(const U16String& value)Gets and sets the name of the VBA project.
SetName(const char16_t* value)Gets and sets the name of the VBA project.
Sign(const DigitalSignature& digitalSignature)Sign this VBA project by a DigitalSignature.
ValidatePassword(const U16String& password)Validates protection password.
ValidatePassword(const char16_t* password)Validates protection password.
VbaProject(VbaProject_Impl* impl)Constructs from an implementation object.
VbaProject(const VbaProject& src)Copy constructor.
~VbaProject()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;
// Init VBA project.
VbaProject vbaProject = workbook.GetVbaProject();
//Saving the Excel file
workbook.Save(u"book1.xlsm");

Aspose::Cells::Cleanup();

See Also