Aspose::Cells::Vba::IVbaModule Class Referenceabstract

Represents module that is contained in VBA project. More...

Inherits Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::Systems::String > GetName ()=0
 Gets the name of Module. More...
 
virtual void SetName (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the name of Module. More...
 
virtual Aspose::Cells::Vba::VbaModuleType GetType ()=0
 Gets the type of module. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetCodes ()=0
 Gets the codes of module. More...
 
virtual void SetCodes (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the codes of module. More...
 

Detailed Description

Represents module that is contained in VBA project.

[C++]
//Instantiating a Workbook object
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
// Init VBA project.
intrusive_ptr<IVbaProject> vbaProject = workbook->GetIVbaProject();
// Add a new module.
int index = vbaProject->GetIVbaModules()->Add(VbaModuleType_Class, new String("test"));
// Get vba module
intrusive_ptr <IVbaModule> vbaModule = vbaProject->GetIVbaModules()->GetObjectByIndex(index);
// Set codes
vbaModule->SetCodes(new String("Sub ShowMessage()\r\nMsgBox \"Welcome to Aspose!\"\r\nEnd Sub"));
//Saving the Excel file
workbook->Save(new String("book1.xlsm"));

Member Function Documentation

◆ GetCodes()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::Vba::IVbaModule::GetCodes ( )
pure virtual

Gets the codes of module.

◆ GetName()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::Vba::IVbaModule::GetName ( )
pure virtual

Gets the name of Module.

◆ GetType()

virtual Aspose::Cells::Vba::VbaModuleType Aspose::Cells::Vba::IVbaModule::GetType ( )
pure virtual

Gets the type of module.

◆ SetCodes()

virtual void Aspose::Cells::Vba::IVbaModule::SetCodes ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the codes of module.

◆ SetName()

virtual void Aspose::Cells::Vba::IVbaModule::SetName ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the name of Module.