Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I am struggling to pass an array to a class. Basically I defined the class as follows: Public xVar As Integer Public Property Let AddtheStuff(TheStuff() As Integer) Dim i As Integer For i = LBound(TheStuff) To UBound(TheStuff) xVar = xVar + TheStuff(i) Next i End Property and I tested the array with the following procedu Sub TestTheObject() Dim MyObject As TheObject Set MyObject = New TheObject Dim ArrVar(1 To 10) As Integer Dim i As Integer For i = 1 To 10 ArrVar(i) = 10 * i Next i MyObject.AddtheStuff = ArrVar MsgBox MyObject.xVar End Sub I always end up with the same compilation error: can't assign an array. Am I doing something wrong? Thanks in advance for your help Charles |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combining cells and array from different sheets into an array to pass to IRR() | Excel Discussion (Misc queries) | |||
Pass an array to Rank | Excel Worksheet Functions | |||
How do I pass an array to a listbox? | Excel Programming | |||
How can I pass an array as TextToDisplay to a hyperlink? | Excel Programming | |||
Pass a variable from a class module | Excel Programming |