Takeshi
2004-01-15 00:24:37 UTC
Hi,
I'm a VB newbie (background C++/C on Linux) writing a couple of VB
functions in Excel to carry out some preliminary data analysis. I have
written a function prototyped as ff:
Private Sub OutputSpreadData(ByRef Dataset, ByVal SpreadType As
enumSpreadType, ByVal TradeType As Long, ByVal lngOptionType As Long)
Dataset is an array of UDTs which had been forward declared as ff:
Private Type Record
x As Long
y As Long
z As Single
End Type
All the code is in one module file in Excel (Module1), so I don't think
scope or vvariable visibility is an issue. The function was called in
code similar to this:
Public sub foo()
dim Dataset() as Record
..... Some code here
Dataset= fnCreateDataset(arg1, arg2,arg3)
OutputSpreadData Dataset, 1, 1, 1 '/* error here */
end Sub
The error message I get is as follows: "Only user-defined types defined
in public object modules can be coerced to or from a variant or passed
to late-bound functions"
Please help... I've already wasted half a day trying to figure this out.
Many thanks in advance
Takeshi
I'm a VB newbie (background C++/C on Linux) writing a couple of VB
functions in Excel to carry out some preliminary data analysis. I have
written a function prototyped as ff:
Private Sub OutputSpreadData(ByRef Dataset, ByVal SpreadType As
enumSpreadType, ByVal TradeType As Long, ByVal lngOptionType As Long)
Dataset is an array of UDTs which had been forward declared as ff:
Private Type Record
x As Long
y As Long
z As Single
End Type
All the code is in one module file in Excel (Module1), so I don't think
scope or vvariable visibility is an issue. The function was called in
code similar to this:
Public sub foo()
dim Dataset() as Record
..... Some code here
Dataset= fnCreateDataset(arg1, arg2,arg3)
OutputSpreadData Dataset, 1, 1, 1 '/* error here */
end Sub
The error message I get is as follows: "Only user-defined types defined
in public object modules can be coerced to or from a variant or passed
to late-bound functions"
Please help... I've already wasted half a day trying to figure this out.
Many thanks in advance
Takeshi