Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can I create in VBA a class with instancing type different from 1 and 2?

1878026431
My application needs to use some classes that are declared in an Add-In. Can
I create in my application the objects (instances) of these classes? VBA
allows to set instancing type for a class module to 1 (Private) or 2
(PublicNotCreateable). Can I use any other instancig model in VBA?

Thanks for answers
Dmitry Petkun


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can I create in VBA a class with instancing type different from 1 and 2?

Dmitry,

VBA supports only Private or PublicNotCreateable classes. Therefore, your
application cannot create objects based on classes in another project. You
can add a procedure to your add-in that will create and return a new
instance of the class. For example,

' in your add-in
Public Sub CreateClassObject() As Class1
Set CreateClassObject = New Class1
End Sub

' in your application
Dim C As AddInProject.Class1
Set C = AddInProject.CreateClassObject()


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Dmitry V. Petkun" wrote in message
...
1878026431
My application needs to use some classes that are declared in an Add-In.

Can
I create in my application the objects (instances) of these classes? VBA
allows to set instancing type for a class module to 1 (Private) or 2
(PublicNotCreateable). Can I use any other instancig model in VBA?

Thanks for answers
Dmitry Petkun




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Can I create in VBA a class with instancing type different from 1 and 2?

What kind of instancing do you require?

"Dmitry V. Petkun" wrote in message ...
1878026431
My application needs to use some classes that are declared in an Add-In. Can
I create in my application the objects (instances) of these classes? VBA
allows to set instancing type for a class module to 1 (Private) or 2
(PublicNotCreateable). Can I use any other instancig model in VBA?

Thanks for answers
Dmitry Petkun

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
Create a Class Schedule Sandy K Excel Discussion (Misc queries) 1 August 27th 08 10:10 PM
How to create a new chart type? eNJay Charts and Charting in Excel 2 August 2nd 08 07:22 AM
How do I create this type of workbook? tonyva New Users to Excel 5 January 26th 07 08:30 AM
How can I create a class reunion directory from a spreadsheet? BRENDA Excel Discussion (Misc queries) 3 October 27th 05 04:09 PM
How do I create a search engine for a class schedule in Excel? Hobo_Billy Excel Worksheet Functions 0 March 11th 05 04:35 PM


All times are GMT +1. The time now is 11:22 PM.

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

About Us

"It's about Microsoft Excel"