public class VbaModule
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
// Init VBA project.
VbaProject vbaProject = workbook.getVbaProject();
// Add a new module.
int index = vbaProject.getModules().add(VbaModuleType.CLASS, "test");
// Get vba module
VbaModule vbaModule = vbaProject.getModules().get(index);
// Set codes
vbaModule.setCodes("Sub ShowMessage()\r\nMsgBox \"Welcome to Aspose!\"\r\nEnd Sub");
//Saving the Excel file
workbook.save("book1.xlsm");
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBinaryCodes()
Gets the binary codes of module.
|
java.lang.String |
getCodes()
Gets the codes of module.
|
java.lang.String |
getName()
Gets the name of Module.
|
int |
getType()
Gets the type of module.
|
void |
setCodes(java.lang.String value)
Sets the codes of module.
|
void |
setName(java.lang.String value)
Sets the name of Module.
|
public java.lang.String getName()
public void setName(java.lang.String value)
public int getType()
See VbaModuleType.
public byte[] getBinaryCodes()
public java.lang.String getCodes()
public void setCodes(java.lang.String value)
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.