Aspose::Cells::Vba::VbaProjectReferenceCollection class

VbaProjectReferenceCollection class

Represents all references of VBA project.

class VbaProjectReferenceCollection

Methods

MethodDescription
AddControlRefrernce(const U16String& name, const U16String& libid, const U16String& twiddledlibid, const U16String& extendedLibid)Add a reference to a twiddled type library and its extended type library.
AddControlRefrernce(const char16_t* name, const char16_t* libid, const char16_t* twiddledlibid, const char16_t* extendedLibid)Add a reference to a twiddled type library and its extended type library.
AddProjectRefrernce(const U16String& name, const U16String& absoluteLibid, const U16String& relativeLibid)Adds a reference to an external VBA project.
AddProjectRefrernce(const char16_t* name, const char16_t* absoluteLibid, const char16_t* relativeLibid)Adds a reference to an external VBA project.
AddRegisteredReference(const U16String& name, const U16String& libid)Add a reference to an Automation type library.
AddRegisteredReference(const char16_t* name, const char16_t* libid)Add a reference to an Automation type library.
Copy(const VbaProjectReferenceCollection& source)Copies references from other VBA project.
Get(int32_t i)Get the reference in the list by the index.
GetCount()
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const VbaProjectReferenceCollection& src)operator=
VbaProjectReferenceCollection(VbaProjectReferenceCollection_Impl* impl)Constructs from an implementation object.
VbaProjectReferenceCollection(const VbaProjectReferenceCollection& src)Copy constructor.
~VbaProjectReferenceCollection()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;
// Init VBA project.
VbaProject vbaProject = workbook.GetVbaProject();
// Add vba project reference
vbaProject.GetReferences().AddRegisteredReference(u"stdole", u"*\\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\\Windows\\system32\\stdole2.tlb#OLE Automation");
//Saving the Excel file
workbook.Save(u"book1.xlsm");

Aspose::Cells::Cleanup();

See Also