Thread: Types in Add-In
View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Types in Add-In

nope..
it MUST be byref alese you get compile error:
UD Type may not be passed Byval.

if you want:
zip the "caller".xls and "called".xla
and mail to address below.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Henning Eiben" wrote:

Am Thu, 21 Oct 2004 05:35:56 -0700 schrieb keepITcool
:

Assume:

I've an addin who's projectname is "PROXL"
in the addin i've a Public module
(check it does NOT contain :

'disabled: Option Private Module
Public Type udPrinter
Name As String
Port As String
End Type

Public Function GetP() As udPrinter
GetP.Name = "Aaap"
GetP.Port = "LPT1"
End Function



In the caller you must add a reference to the addin. = ADD a
reference to "PROXL" !!!!


I've setup a reference to the XLA, since I can call other methods from
the addin.

Sub foo()
Dim x As PROXL.udPrinter
x = PROXL.GetP
End Sub


works for me.



Could it be, that passing the type "ByRef" causes the problem? Does
Excel try to convert the type to variant when calling the XLA? But I
need the ByRef, since I need this parameter as a return-value of the
methode.