public class VbaModuleCollection extends CollectionBase
VbaModule
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
// Init VBA project.
VbaProject vbaProject = workbook.getVbaProject();
// Add a new module.
vbaProject.getModules().add(VbaModuleType.CLASS, "test");
//Saving the Excel file
workbook.save("book1.xlsm");
| Modifier and Type | Method and Description |
|---|---|
int |
add(int type,
java.lang.String name)
Adds module.
|
int |
add(Worksheet sheet)
Adds module for a worksheet.
|
void |
addDesignerStorage(java.lang.String name,
byte[] data) |
int |
addUserForm(java.lang.String name,
java.lang.String codes,
byte[] designerStorage)
Inser user form into VBA Project.
|
VbaModule |
get(int index)
Gets
VbaModule in the list by the index. |
VbaModule |
get(java.lang.String name)
Gets
VbaModule in the list by the name. |
byte[] |
getDesignerStorage(java.lang.String name)
Represents the data of Designer.
|
void |
remove(java.lang.String name)
Remove the module by the name
|
void |
remove(Worksheet sheet)
Removes module for a worksheet.
|
public void addDesignerStorage(java.lang.String name,
byte[] data)
name - data - public byte[] getDesignerStorage(java.lang.String name)
Remarks
We do not support to parse them. Just only for copying.public int add(Worksheet sheet)
sheet - The worksheetpublic int add(int type,
java.lang.String name)
type - VbaModuleType. The type of module.name - The name of module.public int addUserForm(java.lang.String name,
java.lang.String codes,
byte[] designerStorage)
name - The name of user formcodes - The codes for the user formdesignerStorage - the designer setting about the user formpublic VbaModule get(int index)
VbaModule in the list by the index.get in class CollectionBaseindex - The index.public void remove(Worksheet sheet)
sheet - The worksheetpublic void remove(java.lang.String name)
name - 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.