java.lang.Object
com.aspose.cells.VbaModule
public class VbaModule
- extends java.lang.Object
Represents the module in VBA project.
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");
|
Property Getters/Setters Summary |
java.lang.String | getCodes() | |
void | setCodes(java.lang.String) | |
|
Gets and sets the codes of module.
|
java.lang.String | getName() | |
void | setName(java.lang.String) | |
|
Gets and sets the name of Module.
|
int | getType() | |
|
Gets the type of module.
The value of the property is VbaModuleType integer constant. |
|
Property Getters/Setters Detail |
getName/setName | |
public java.lang.String getName() / public void setName(java.lang.String value)
|
-
Gets and sets the name of Module.
setName | |
public void setName(java.lang.String value)
|
-
Gets and sets the name of Module.
getType | |
public int getType()
|
-
Gets the type of module.
The value of the property is VbaModuleType integer constant.
getCodes/setCodes | |
public java.lang.String getCodes() / public void setCodes(java.lang.String value)
|
-
Gets and sets the codes of module.
setCodes | |
public void setCodes(java.lang.String value)
|
-
Gets and sets the codes of module.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.