VbaModule

Inheritance: java.lang.Object

public class VbaModule

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");

Methods

MethodDescription
equals(Object arg0)
getClass()
getCodes()Gets the codes of module.
getName()Gets the name of Module.
getType()Gets the type of module.
hashCode()
notify()
notifyAll()
setCodes(String value)Sets the codes of module.
setName(String value)Sets the name of Module.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCodes()

public String getCodes()

Gets the codes of module.

Returns: java.lang.String

getName()

public String getName()

Gets the name of Module.

Returns: java.lang.String

getType()

public int getType()

Gets the type of module.

See VbaModuleType.

Returns: int

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setCodes(String value)

public void setCodes(String value)

Sets the codes of module.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setName(String value)

public void setName(String value)

Sets the name of Module.

Parameters:

ParameterTypeDescription
valuejava.lang.String

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int