hello,
Here is my problem:
I have a module in wich I have a public variable, a public function and some private functions. When I call the public function from a userform all that private functions are called and the public variable takes a value. Why can't I see that public variable from the form after I call the public function. I need to see what value the variable has taken. It gives me run-error '9': Subscript out of range.
I cant make the public funtion to return the value 'cause the public value is of a type defined by me and is a structure.
The error is recived when I try do rach the structure elements with for.
Here is the code:
'*** Module SWMod ****
'*** user form ***
SWMod.OpenProject
For i = 0 To UBound(SWMod.ARL) <--- HERE COMES THE ERROR
cbARL.AddItem SW.ARL(i).ARLName
Next i
End Sub
Here is my problem:
I have a module in wich I have a public variable, a public function and some private functions. When I call the public function from a userform all that private functions are called and the public variable takes a value. Why can't I see that public variable from the form after I call the public function. I need to see what value the variable has taken. It gives me run-error '9': Subscript out of range.
I cant make the public funtion to return the value 'cause the public value is of a type defined by me and is a structure.
The error is recived when I try do rach the structure elements with for.
Here is the code:
'*** Module SWMod ****
Code:
Public Type ARLType
ARLGen As Long
ARLCus As Long
ARLSpe As Long
ARLName As String
ARLLib As String
ARLVer As String
ARLTVer As String
ArlSubSys As String
ArlFile() As FileType
End Type
Public ARL() As ARLType
Public Sub OpenProject()
...
End sub
SWMod.OpenProject
For i = 0 To UBound(SWMod.ARL) <--- HERE COMES THE ERROR
cbARL.AddItem SW.ARL(i).ARLName
Next i
End Sub