Re: Error in Call statement

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Larry Serflaten" <serflaten@xxxxxxxxxxxxxx> wrote in message news:ub3erIekIHA.6092@xxxxxxxxxxxxxxxxxxxxxxx

"Marv" <marvwade@xxxxxxxxxxxxxxx> wrote
I have the following UDT defined in a base module:
<snipped>
However, when I try to run it I get the message:
" Only user defined types defined in public pbject modules can be coerced
to or from a variant or passed to a late bound function."

I am at a loss to understand what this means. I think I have the UDT
defined
in a public base module. What obvious thing am I missing?



I keep forgetting if its the UDT or the routine that needs attention, so
try the easiest one first....

Change:

Public Sub AdjustPrtLine(ModelRec)
' do something
End Sub


To:

Friend Sub AdjustPrtLine(ModelRec)
' do something
End Sub


See it that helps....
LFS



Larry, I tried it but the editor red lines it. I looked Friend up in Help and it appears to me that it
is to be used in a Class module. I had never heard of it before.

.



Relevant Pages

  • Re: Error in Call statement
    ... " Only user defined types defined in public pbject modules can be coerced ... to or from a variant or passed to a late bound function." ... I think I have the UDT ... Public Sub AdjustPrtLine ...
    (microsoft.public.vb.general.discussion)
  • Re: user defined type and collection
    ... build a new class clsAddress intead of UDT (you can just use same public ... have run into a couple of problems trying to store the UDT. ... Street As String ... Public Sub LoadAddress() ...
    (microsoft.public.access.modulesdaovba)
  • Re: UDT and collection
    ... I don't understand this because my UDT is declared public. ... Public Type Foo ... Public Sub Main ... Dim c As Collection ...
    (microsoft.public.vb.general.discussion)
  • UDT and collection
    ... I am trying to add a UDT to a collection. ... Public Type Foo ... Public Sub Main ... Dim c As Collection ...
    (microsoft.public.vb.general.discussion)