Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have created an Add-In (XLA) in VBA that exposes a user defined type in a public module. I want to use that type in an excel-app to store data and to pass it to functions of the Add-In. But unfortunatly I can't compile my XLS, I always get an error about that user-defined types must be in public modules (or something similar; well I get the message in german I don't know the english word of the message). What am I missing? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Henning,
But unfortunatly I can't compile my XLS, I always get an error about that user-defined types must be in public modules (or something similar; well I get the message in german I don't know the english word of the message). You must define the type in the project that is calling the addin too. Regards, Jan Karel Pieterse Excel MVP www.jkp-ads.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Am Thu, 21 Oct 2004 09:22:32 +0200 schrieb Jan Karel Pieterse
: Hi Henning, But unfortunatly I can't compile my XLS, I always get an error about that user-defined types must be in public modules (or something similar; well I get the message in german I don't know the english word of the message). You must define the type in the project that is calling the addin too. I thought of something like that already ... so I tried this: --- cut --- cut --- cut --- cut --- app.XLS: modPublic includes: Type Period Year As Integer, Month As Integer End Type Public Function Foo Dim myPeriode As Periode Call lib.Bar(myPeriode) End Function --- cut --- cut --- cut --- cut --- lib.XLA: modPublic includes: Type Period Year As Integer, Month As Integer End Type Public Sub Bar (ByRef SubPeriod As Period) ... End Sub --- cut --- cut --- cut --- cut --- But the "Call lib.Bar(myPeriode)" won't compile :( |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Henning,
But the "Call lib.Bar(myPeriode)" won't compile :( Because there is a typo in this sub: Public Function Foo Dim myPeriode As Periode Call lib.Bar(myPeriode) End Function Change Periode to Period. Have you got "require variable declaration" checked in tools, options editor of the VBE? If not, I recommend doing so. It will add "Option Explicit" to the top of any new module (you'll have to add it yourself to existing ones) and would have given a compile error on the Dim statement. Regards, Jan Karel Pieterse Excel MVP www.jkp-ads.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Am Thu, 21 Oct 2004 09:48:57 +0200 schrieb Jan Karel Pieterse
: Hi Henning, But the "Call lib.Bar(myPeriode)" won't compile :( Because there is a typo in this sub: Public Function Foo Dim myPeriode As Periode Call lib.Bar(myPeriode) End Function Change Periode to Period. Well ... That was just a typo in the post ... and I do have explicit declaration turned on. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Henning,
Well ... That was just a typo in the post ... and I do have explicit declaration turned on. OK, it was worth the try <smile. No more time to investigate this one further though. Regards, Jan Karel Pieterse Excel MVP www.jkp-ads.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error bar types | Charts and Charting in Excel | |||
How can I hide unused file types from file types list in save dial | Excel Discussion (Misc queries) | |||
Excel 2007 error "some chart types cannot be combined with other chart types. Select a different chart types" | Charts and Charting in Excel | |||
Trendline Types | Charts and Charting in Excel | |||
Encryption Types | Excel Discussion (Misc queries) |