Type MyType
        Nick As String
        Status As Boolean
        Something As Integer
End Type

Sub BlahBlah
        Dim MyArray(7) As MyType

        Dim Sheet As Object, Range As Object
        Sheet=ThisComponent.getSheets().getByName("Sheet1")
        Range=Sheet.getCellRangeByPosition(1,3,8,3) ' One row, eight columns

        Dim TempArray() As Variant
        TempArray()=Range.getDataArray()
        MyArray().Nick=TempArray(0) ' This line produces the error message
”BASIC runtime error. Object variable not set.”
End Sub

As I commented above, I get an error message. I have checked that all
variables exist and that arrays have the correct size and so on. Is
this just not possible?

Suggestions?

What I want to achieve? Well, in this short example, let's say that
the cell range B4:I4 contains the following:
B4: "One"
C4: "Two"
D4: "Three"
E4: "Four"
F4: "Five"
G4: "Six"
H4: "Seven"
I4: "Eight"

Then I expect the following variables containing the following:
MyArray(1).Nick="One"
MyArray(2).Nick="Two"
MyArray(3).Nick="Three"
MyArray(4).Nick="Four"
MyArray(5).Nick="Five"
MyArray(6).Nick="Six"
MyArray(7).Nick="Seven"
MyArray(8).Nick="Eight"

Am I totally approaching this the completely wrong way?

Johnny Rosenberg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to