silentquasar
New Member
- Joined
- May 21, 2010
- Messages
- 3
Hi,
In one of the modules for a workbook of mine, I have The following type defined:
and then the following declaration of an array of this type:
I have a subroutine in that module that populates the Mode_S_Message_Records array; then some other functions in the module can use the array.
What I'd also like to be able to do is have the UDFs check if the array is empty (hasn't been populated) and run the sub to populate the array if need be. The problem I run into is as follows: If I try to do the following in as sub or function:
I get this error:
In one of the modules for a workbook of mine, I have The following type defined:
Code:
Public Type Mode_S_Message_Record
Mode_S_ID As String
DF As String
Msg_Type As String
NACv As String
ADSB_ID As String
OTGI As String
NACp As String
SIL As String
Lat As String
Lon As String
Alt As String
CPR As String
Mode_S_Message As String
End Type
Code:
Public Mode_S_Message_Records() As Mode_S_Message_Record
What I'd also like to be able to do is have the UDFs check if the array is empty (hasn't been populated) and run the sub to populate the array if need be. The problem I run into is as follows: If I try to do the following in as sub or function:
Code:
If IsEmpty(Mode_S_Message_Records) Then
Populate_Mode_S_Message_Records
End If
"Compiler error: Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound function".
Can anyone tell me what I'm doing wrong? All I want to do is find out if my array is empty!