VbaProjectReferenceCollection
Innehåll
[
Dölj
]VbaProjectReferenceCollection class
Representerar alla referenser till VBA-projekt.
public class VbaProjectReferenceCollection : CollectionBase<VbaProjectReference>
Egenskaper
namn | Beskrivning |
---|---|
Capacity { get; set; } | |
Count { get; } | |
Item { get; } | Få referensen i listan genom index. |
Item { get; set; } |
Metoder
namn | Beskrivning |
---|---|
AddControlRefrernce(string, string, string, string) | Lägg till en referens till ett tvistad typbibliotek och dess utökade typbibliotek. |
AddProjectRefrernce(string, string, string) | Lägger till en referens till ett externt VBA-projekt. |
AddRegisteredReference(string, string) | Lägg till en referens till ett bibliotek av automationstyp. |
BinarySearch(VbaProjectReference) | |
BinarySearch(VbaProjectReference, IComparer<VbaProjectReference>) | |
BinarySearch(int, int, VbaProjectReference, IComparer<VbaProjectReference>) | |
Clear() | |
Contains(VbaProjectReference) | |
Copy(VbaProjectReferenceCollection) | Kopierar referenser från andra VBA-projekt. |
CopyTo(VbaProjectReference[]) | |
CopyTo(VbaProjectReference[], int) | |
CopyTo(int, VbaProjectReference[], int, int) | |
Exists(Predicate<VbaProjectReference>) | |
Find(Predicate<VbaProjectReference>) | |
FindAll(Predicate<VbaProjectReference>) | |
FindIndex(Predicate<VbaProjectReference>) | |
FindIndex(int, Predicate<VbaProjectReference>) | |
FindIndex(int, int, Predicate<VbaProjectReference>) | |
FindLast(Predicate<VbaProjectReference>) | |
FindLastIndex(Predicate<VbaProjectReference>) | |
FindLastIndex(int, Predicate<VbaProjectReference>) | |
FindLastIndex(int, int, Predicate<VbaProjectReference>) | |
GetEnumerator() | |
IndexOf(VbaProjectReference) | |
IndexOf(VbaProjectReference, int) | |
IndexOf(VbaProjectReference, int, int) | |
LastIndexOf(VbaProjectReference) | |
LastIndexOf(VbaProjectReference, int) | |
LastIndexOf(VbaProjectReference, int, int) | |
RemoveAt(int) |
Exempel
[C#]
//Instantiering av ett arbetsboksobjekt
Workbook workbook = new Workbook();
// Init VBA-projekt.
VbaProject vbaProject = workbook.VbaProject;
// Lägg till vba-projektreferens
vbaProject.References.AddRegisteredReference("stdole", "*\\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\\Windows\\system32\\stdole2.tlb#OLE Automation");
//Spara Excel-filen
workbook.Save("book1.xlsm");
[Visual Basic]
'Instantiera ett arbetsboksobjekt
Dim workbook As Workbook = New Workbook()
'Init VBA-projekt.
Dim vbaProject as VbaProject = workbook.VbaProject
'Lägg till vba-projektreferens
vbaProject.References.AddRegisteredReference("stdole", "*\\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\\Windows\\system32\\stdole2.tlb#OLE Automation")
'Sparar Excel-filen
workbook.Save("book1.xlsm")
Se även
- class CollectionBase<T>
- class VbaProjectReference
- namnutrymme Aspose.Cells.Vba
- hopsättning Aspose.Cells