Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Types in Add-In

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Types in Add-In

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Types in Add-In

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Types in Add-In

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Types in Add-In

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Types in Add-In

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error bar types Office_user Charts and Charting in Excel 1 January 10th 10 06:47 PM
How can I hide unused file types from file types list in save dial Estra Q Excel Discussion (Misc queries) 1 December 17th 09 12:36 PM
Excel 2007 error "some chart types cannot be combined with other chart types. Select a different chart types" roadsidetree Charts and Charting in Excel 15 June 2nd 09 10:53 AM
Trendline Types Dave Charts and Charting in Excel 2 October 3rd 07 05:39 PM
Encryption Types Werner Rohrmoser Excel Discussion (Misc queries) 0 August 5th 05 07:31 AM


All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"