Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Class Modules

Can you create a Class Module using VBA without using the Property Lets and
Gets???
Can you instead just Publicly declare the Class Module?
If so....does anyone have a full example from the creation of the class
module through creation of the code for the Regular code module???
I would appreciate it

Than k you


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Class Modules

Lets and Gets and just the write/read specific properties. If you just
declare a public variable, that effectively becomes a read/write property.
In summary, yes you can.

Here's a very simple Class

Public myVar

Public Function myMethod() As Long
myMethod = myVar * 5
End Function


and this is the class invoked in a normal module

Sub test()
Dim myClass As Class1

Set myClass = New Class1
With myClass
.myVar = 17
MsgBox .myMethod()
End With

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ibeetb" wrote in message
...
Can you create a Class Module using VBA without using the Property Lets

and
Gets???
Can you instead just Publicly declare the Class Module?
If so....does anyone have a full example from the creation of the class
module through creation of the code for the Regular code module???
I would appreciate it

Than k you




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
Naming class modules in Excel 2002 bryan Excel Discussion (Misc queries) 2 December 13th 04 11:42 AM
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
Event - RaiseEvents Within Class Modules John Peterson[_3_] Excel Programming 4 July 17th 03 12:53 AM


All times are GMT +1. The time now is 06:04 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"