This most inconvient function occourred about this code. It's much longer than this, with a lot of user defined functions, but that's the general area.
_________________________
Dim firstIdx As Integer 'first dimension array idx, and 2nd and 3rd next lines
Dim secondIdx As Integer
Dim thirdIdx As Integer
Dim product As String
Dim ender As Integer
Dim ender3 As Integer
'this double loop loads the all data array
Do While allData(firstIdx, 0, 0) <> "NULL"
product = allData(firstIdx, 0, 0)
secondIdx = 1
thirdIdx = 1
iTimeArray = timeKeeper(iRange, iDateStart, iDateInterval)
ender = arrayEnder
Do While secondIdx <= ender
allData(firstIdx, secondIdx, 0) = iTimeArray(secondIdx) <- This line.
rowArray = dataArrayer(iRange, product, iTimeArray(secondIdx), iShift)
ender3 = arrayEnder
Do While thirdIdx <= ender3
allData(firstIdx, secondIdx, thirdIdx) = rowArray(thirdIdx)
thirdIdx = thirdIdx + 1
If thirdIdx = ender3 Then allData(firstIdx, secondIdx, thirdIdx) = "NULL"
Loop
secondIdx = secondIdx + 1
If secondIdx = ender Then allData(firstIdx, secondIdx, 0) = "NULL"
Loop
firstIdx = firstIdx + 1
Loop
__________________________
TimeKeeper is a function that returns and array with DualDates (code below) and copied to iTimeArray, but then I get this crazy error message.
Only user-defined types defined in public objects modules can be coerced to or from a variant or passed to late-bound functions.
I have no idea what is going on here, and for reference I have my public data declarations and User defined data types.
____________________________
Public arrayEnder As Integer 'each function will use this variable so the "Null" string
'will be at the end of each array in allData
Public allData() As Variant 'This array contains all the data needed,
'the first dimesion will be product names as Strings
'the second will be applicable time intervals as DualDates
'the final will be the relevant data rows as integers
Type DualDate ' A User Defined Datatype with 2 Dates, meant for showing a span of time.
startDate As Date
endDate As Date
End Type
Type DualInt 'for returning row and column coordinates
row As Integer
col As Integer
End Type
___________________________________
any ideas, do I have to rework my entire idea and get rid of the DualDate UDT?
Thanks
PegasusJF
_________________________
Dim firstIdx As Integer 'first dimension array idx, and 2nd and 3rd next lines
Dim secondIdx As Integer
Dim thirdIdx As Integer
Dim product As String
Dim ender As Integer
Dim ender3 As Integer
'this double loop loads the all data array
Do While allData(firstIdx, 0, 0) <> "NULL"
product = allData(firstIdx, 0, 0)
secondIdx = 1
thirdIdx = 1
iTimeArray = timeKeeper(iRange, iDateStart, iDateInterval)
ender = arrayEnder
Do While secondIdx <= ender
allData(firstIdx, secondIdx, 0) = iTimeArray(secondIdx) <- This line.
rowArray = dataArrayer(iRange, product, iTimeArray(secondIdx), iShift)
ender3 = arrayEnder
Do While thirdIdx <= ender3
allData(firstIdx, secondIdx, thirdIdx) = rowArray(thirdIdx)
thirdIdx = thirdIdx + 1
If thirdIdx = ender3 Then allData(firstIdx, secondIdx, thirdIdx) = "NULL"
Loop
secondIdx = secondIdx + 1
If secondIdx = ender Then allData(firstIdx, secondIdx, 0) = "NULL"
Loop
firstIdx = firstIdx + 1
Loop
__________________________
TimeKeeper is a function that returns and array with DualDates (code below) and copied to iTimeArray, but then I get this crazy error message.
Only user-defined types defined in public objects modules can be coerced to or from a variant or passed to late-bound functions.
I have no idea what is going on here, and for reference I have my public data declarations and User defined data types.
____________________________
Public arrayEnder As Integer 'each function will use this variable so the "Null" string
'will be at the end of each array in allData
Public allData() As Variant 'This array contains all the data needed,
'the first dimesion will be product names as Strings
'the second will be applicable time intervals as DualDates
'the final will be the relevant data rows as integers
Type DualDate ' A User Defined Datatype with 2 Dates, meant for showing a span of time.
startDate As Date
endDate As Date
End Type
Type DualInt 'for returning row and column coordinates
row As Integer
col As Integer
End Type
___________________________________
any ideas, do I have to rework my entire idea and get rid of the DualDate UDT?
Thanks
PegasusJF