VbaProject

Inheritance: java.lang.Object

public class VbaProject

Represents the VBA project.

Example

         //Instantiating a Workbook object
         Workbook workbook = new Workbook();
          // Init VBA project.
         VbaProject vbaProject = workbook.getVbaProject();
         //Saving the Excel file
         workbook.save("book1.xlsm");

Methods

MethodDescription
copy(VbaProject source)Copy VBA project from other file.
equals(Object arg0)
getCertRawData()Gets certificate raw data if this VBA project is signed.
getClass()
getEncoding()Gets the encoding of VBA project.
getIslockedForViewing()Indicates whether this VBA project is locked for viewing.
getModules()Gets all VbaModule objects.
getName()Gets the name of the VBA project.
getReferences()Gets all references of VBA project.
hashCode()
isProtected()Indicates whether this VBA project is protected.
isSigned()Indicates whether VBAcode is signed or not.
isValidSigned()Indicates whether the signature of VBA project is valid or not.
notify()
notifyAll()
protect(boolean islockedForViewing, String password)Protects or unprotects this VBA project.
setEncoding(Encoding value)Sets the encoding of VBA project.
setName(String value)Sets the name of the VBA project.
sign(DigitalSignature digitalSignature)Sign this VBA project by a DigitalSignature
toString()
validatePassword(String password)Validates protection password.
wait()
wait(long arg0)
wait(long arg0, int arg1)

copy(VbaProject source)

public void copy(VbaProject source)

Copy VBA project from other file.

Parameters:

ParameterTypeDescription
sourceVbaProject

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getCertRawData()

public byte[] getCertRawData()

Gets certificate raw data if this VBA project is signed.

Returns: byte[]

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getEncoding()

public Encoding getEncoding()

Gets the encoding of VBA project.

Returns: Encoding

getIslockedForViewing()

public boolean getIslockedForViewing()

Indicates whether this VBA project is locked for viewing.

Returns: boolean

getModules()

public VbaModuleCollection getModules()

Gets all VbaModule objects.

Returns: VbaModuleCollection

getName()

public String getName()

Gets the name of the VBA project.

Returns: java.lang.String

getReferences()

public VbaProjectReferenceCollection getReferences()

Gets all references of VBA project.

Returns: VbaProjectReferenceCollection

hashCode()

public native int hashCode()

Returns: int

isProtected()

public boolean isProtected()

Indicates whether this VBA project is protected.

Returns: boolean

isSigned()

public boolean isSigned()

Indicates whether VBAcode is signed or not.

Returns: boolean

isValidSigned()

public boolean isValidSigned()

Indicates whether the signature of VBA project is valid or not.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

protect(boolean islockedForViewing, String password)

public void protect(boolean islockedForViewing, String password)

Protects or unprotects this VBA project.

Remarks

If islockedForViewing is true, the password could not be null.

Parameters:

ParameterTypeDescription
islockedForViewingbooleanindicates whether locks project for viewing.
passwordjava.lang.StringIf the value is null, unprotects this VBA project, otherwise projects the this VBA project.

setEncoding(Encoding value)

public void setEncoding(Encoding value)

Sets the encoding of VBA project.

Parameters:

ParameterTypeDescription
valueEncoding

setName(String value)

public void setName(String value)

Sets the name of the VBA project.

Parameters:

ParameterTypeDescription
valuejava.lang.String

sign(DigitalSignature digitalSignature)

public void sign(DigitalSignature digitalSignature)

Sign this VBA project by a DigitalSignature

Parameters:

ParameterTypeDescription
digitalSignatureDigitalSignatureDigitalSignature

toString()

public String toString()

Returns: java.lang.String

validatePassword(String password)

public boolean validatePassword(String password)

Validates protection password.

Parameters:

ParameterTypeDescription
passwordjava.lang.Stringthe password

Returns: boolean - Whether password is the protection password of this VBA project

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