In a module I have the following declarations:
In a different module:Code:Public Type MyUDT X As Single Y() As Single End Type ' Public MyUDTInstance() As MyUDT
Finally, in a form there's the calling statement:Code:Sub MySub(DummyVarName) '... ' Some operations are performed here 'with the quantities: 'DummyVarName(SomeIndex).X 'and 'DummyVarName(SomeIndex).Y(SomeOtherIndex) '... End Sub
Of course, MyUDTInstance and MyUDTInstance(SomeIndex).Y(SomeOtherIndex) have been previously ReDimensioned and given values.Code:Call MySub(MyUDTInstance)
Now, when the sub is called I get the error you can see in the attached picture which can be translated into English more or less as follows:
"Compiler error.
Only those user defined types from public obejct modules can be passed to functions linked at run time or forced to or from a variant"
Anyone knows the reason?




Reply With Quote