Class VbaProject

Class VbaProject

Namespace: Aspose.Cells.Vba
Assembly: Aspose.Cells.dll (25.2.0)

Represents the VBA project.

public class VbaProject

Inheritance

objectVbaProject

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

//Instantiating a Workbook object
Workbook workbook = new Workbook();
 // Init VBA project.
VbaProject vbaProject = workbook.VbaProject;
//Saving the Excel file
workbook.Save("book1.xlsm");
'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()
'Init VBA project.
Dim vbaProject as VbaProject  = workbook.VbaProject
'Saving the Excel file
workbook.Save("book1.xlsm")

Properties

CertRawData

Gets certificate raw data if this VBA project is signed.

public byte[] CertRawData { get; }

Property Value

byte[]

Encoding

Gets and sets the encoding of VBA project.

public Encoding Encoding { get; set; }

Property Value

Encoding

IsProtected

Indicates whether this VBA project is protected.

public bool IsProtected { get; }

Property Value

bool

IsSigned

Indicates whether VBAcode is signed or not.

public bool IsSigned { get; }

Property Value

bool

IsValidSigned

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

public bool IsValidSigned { get; }

Property Value

bool

IslockedForViewing

Indicates whether this VBA project is locked for viewing.

public bool IslockedForViewing { get; }

Property Value

bool

Modules

Gets all Aspose.Cells.Vba.VbaModule objects.

public VbaModuleCollection Modules { get; }

Property Value

VbaModuleCollection

Name

Gets and sets the name of the VBA project.

public string Name { get; set; }

Property Value

string

References

Gets all references of VBA project.

public VbaProjectReferenceCollection References { get; }

Property Value

VbaProjectReferenceCollection

Methods

Copy(VbaProject)

Copy VBA project from other file.

public void Copy(VbaProject source)

Parameters

source VbaProject

Protect(bool, string)

Protects or unprotects this VBA project.

public void Protect(bool islockedForViewing, string password)

Parameters

islockedForViewing bool

indicates whether locks project for viewing.

password string

If the value is null, unprotects this VBA project, otherwise projects the this VBA project.

Remarks

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

Sign(DigitalSignature)

Sign this VBA project by a DigitalSignature

public void Sign(DigitalSignature digitalSignature)

Parameters

digitalSignature DigitalSignature

DigitalSignature

ValidatePassword(string)

Validates protection password.

public bool ValidatePassword(string password)

Parameters

password string

the password

Returns

bool

Whether password is the protection password of this VBA project