Class VbaModuleCollection
Namespace: Aspose.Cells.Vba
Assembly: Aspose.Cells.dll (25.2.0)
Represents the list of Aspose.Cells.Vba.VbaModule
public class VbaModuleCollection : CollectionBase<vbamodule>, IList<vbamodule>, ICollection<vbamodule>, IEnumerable<vbamodule>, ICollection, IEnumerable
Inheritance
object ← CollectionBase<vbamodule> ← VbaModuleCollection
Implements
IList<vbamodule>, ICollection<vbamodule>, IEnumerable<vbamodule>, ICollection, IEnumerable
Inherited Members
CollectionBase<vbamodule>.BinarySearch(VbaModule), CollectionBase<vbamodule>.BinarySearch(VbaModule, IComparer<vbamodule>), CollectionBase<vbamodule>.BinarySearch(int, int, VbaModule, IComparer<vbamodule>), CollectionBase<vbamodule>.Contains(VbaModule), CollectionBase<vbamodule>.CopyTo(VbaModule[]), CollectionBase<vbamodule>.CopyTo(VbaModule[], int), CollectionBase<vbamodule>.CopyTo(int, VbaModule[], int, int), CollectionBase<vbamodule>.Exists(Predicate<vbamodule>), CollectionBase<vbamodule>.Find(Predicate<vbamodule>), CollectionBase<vbamodule>.FindAll(Predicate<vbamodule>), CollectionBase<vbamodule>.FindIndex(Predicate<vbamodule>), CollectionBase<vbamodule>.FindIndex(int, Predicate<vbamodule>), CollectionBase<vbamodule>.FindIndex(int, int, Predicate<vbamodule>), CollectionBase<vbamodule>.FindLast(Predicate<vbamodule>), CollectionBase<vbamodule>.FindLastIndex(Predicate<vbamodule>), CollectionBase<vbamodule>.FindLastIndex(int, Predicate<vbamodule>), CollectionBase<vbamodule>.FindLastIndex(int, int, Predicate<vbamodule>), CollectionBase<vbamodule>.IndexOf(VbaModule), CollectionBase<vbamodule>.IndexOf(VbaModule, int), CollectionBase<vbamodule>.IndexOf(VbaModule, int, int), CollectionBase<vbamodule>.LastIndexOf(VbaModule), CollectionBase<vbamodule>.LastIndexOf(VbaModule, int), CollectionBase<vbamodule>.LastIndexOf(VbaModule, int, int), CollectionBase<vbamodule>.GetEnumerator(), CollectionBase<vbamodule>.Clear(), CollectionBase<vbamodule>.RemoveAt(int), CollectionBase<vbamodule>.OnClearComplete(), CollectionBase<vbamodule>.OnClear(), CollectionBase<vbamodule>.Capacity, CollectionBase<vbamodule>.Count, CollectionBase<vbamodule>.InnerList, CollectionBase<vbamodule>.this[int], 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;
// Add a new module.
vbaProject.Modules.Add(VbaModuleType.Class, "test");
//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
'Add a new module.
vbaProject.Modules.Add(VbaModuleType.Class, "test")
'Saving the Excel file
workbook.Save("book1.xlsm")
Properties
this[int]
Gets Aspose.Cells.Vba.VbaModule in the list by the index.
public VbaModule this[int index] { get; }
Property Value
this[string]
Gets Aspose.Cells.Vba.VbaModule in the list by the name.
public VbaModule this[string name] { get; }
Property Value
Methods
Add(Worksheet)
Adds module for a worksheet.
public int Add(Worksheet sheet)
Parameters
sheet
Worksheet
The worksheet
Returns
Add(VbaModuleType, string)
Adds module.
public int Add(VbaModuleType type, string name)
Parameters
type
VbaModuleType
The type of module.
name
string
The name of module.
Returns
AddDesignerStorage(string, byte[])
public void AddDesignerStorage(string name, byte[] data)
Parameters
name
string
data
byte[]
AddUserForm(string, string, byte[])
Inser user form into VBA Project.
public int AddUserForm(string name, string codes, byte[] designerStorage)
Parameters
name
string
The name of user form
codes
string
The codes for the user form
designerStorage
byte[]
the designer setting about the user form
Returns
GetDesignerStorage(string)
Represents the data of Designer.
public byte[] GetDesignerStorage(string name)
Parameters
name
string
Returns
byte[]
Remarks
We do not support to parse them. Just only for copying.
Remove(Worksheet)
Removes module for a worksheet.
public void Remove(Worksheet sheet)
Parameters
sheet
Worksheet
The worksheet
Remove(string)
Remove the module by the name
public void Remove(string name)
Parameters
name
string
</vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule></vbamodule>