Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default class modules beginner

Hi.

I've just started to work with writing class modules.

It seems that when a class is first defined, after
dimensioning an object in that class, and setting the
object to a New member of the class, the class's
properties and methods are not available like this:

dim objClass as clsTest
set objClass = New clsTest
objClass.DoSomething

I'm saying that after typing the objClass. , there is no
list of properties and methods to choose from... in order
to use them, you have to know what they are, or go look.

Yet, when the newly defined class is exported to a file,
and then imported to another VBA application, the methods
and properties do become selectable.

Is this normal? Or is there something that I am not doing
which would make them available in the first setting.

Also, it seems that each newly defined class needs to have
it's own class module. Is this correct? Or can multiple
classes be defined in a single class module in a way that
I am not seeing?

Thanks.
Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default class modules beginner

Mark,

You should see the Intellisense dropdown list of properties and
methods for your class module. Ensure that you don't have a
compile error elsewhere in the code. This sometimes prevents the
list from being properly displayed.

You can have exactly one class per class module. You cannot have
more than one class per class module, and the name of the class
is the name of the module.

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


"mark" wrote in message
...
Hi.

I've just started to work with writing class modules.

It seems that when a class is first defined, after
dimensioning an object in that class, and setting the
object to a New member of the class, the class's
properties and methods are not available like this:

dim objClass as clsTest
set objClass = New clsTest
objClass.DoSomething

I'm saying that after typing the objClass. , there is no
list of properties and methods to choose from... in order
to use them, you have to know what they are, or go look.

Yet, when the newly defined class is exported to a file,
and then imported to another VBA application, the methods
and properties do become selectable.

Is this normal? Or is there something that I am not doing
which would make them available in the first setting.

Also, it seems that each newly defined class needs to have
it's own class module. Is this correct? Or can multiple
classes be defined in a single class module in a way that
I am not seeing?

Thanks.
Mark




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default class modules beginner

Thanks Chip.

I went and tried it again, and sure enough, it was visible
as you said that it should be. I don't know what was
causing it not to be before.

Oh well.
Thanks,
Mark

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
Class Modules mark Excel Programming 7 April 14th 04 10:10 PM
Class Modules ibeetb Excel Programming 1 January 5th 04 10:04 PM
Class modules pk Excel Programming 2 October 3rd 03 03:45 AM
Class Modules vs Modules Jeff Marshall Excel Programming 2 September 28th 03 07:57 PM
Class Modules Siphuncle Excel Programming 2 August 12th 03 06:37 PM


All times are GMT +1. The time now is 12:47 AM.

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"