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
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
source | VbaProject |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.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:
Parameter | Type | Description |
---|---|---|
islockedForViewing | boolean | indicates whether locks project for viewing. |
password | java.lang.String | If 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:
Parameter | Type | Description |
---|---|---|
value | Encoding |
setName(String value)
public void setName(String value)
Sets the name of the VBA project.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
sign(DigitalSignature digitalSignature)
public void sign(DigitalSignature digitalSignature)
Sign this VBA project by a DigitalSignature
Parameters:
Parameter | Type | Description |
---|---|---|
digitalSignature | DigitalSignature | DigitalSignature |
toString()
public String toString()
Returns: java.lang.String
validatePassword(String password)
public boolean validatePassword(String password)
Validates protection password.
Parameters:
Parameter | Type | Description |
---|---|---|
password | java.lang.String | the 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:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |