Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA and Constructors; exist?


Do constructors exist in VBA? All I have seen are static type
variables for the object's variables. For example, if you use the ne
statement, does it just create an object and you have to initialize it
fields, or does it look for a constructor?

Also, for the class module, do you need to export the code to use b
able to save it as the correct object name, say "person.cls"

--
McManCS
-----------------------------------------------------------------------
McManCSU's Profile: http://www.excelforum.com/member.php...fo&userid=2437
View this thread: http://www.excelforum.com/showthread.php?threadid=39178

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA and Constructors; exist?

for a class, I think the initialize event is considered the constructor:

Private Sub Class_Initialize()

End Sub

--
Regards,
Tom Ogilvy


"McManCSU" wrote in
message ...

Do constructors exist in VBA? All I have seen are static typed
variables for the object's variables. For example, if you use the new
statement, does it just create an object and you have to initialize its
fields, or does it look for a constructor?

Also, for the class module, do you need to export the code to use be
able to save it as the correct object name, say "person.cls"?


--
McManCSU
------------------------------------------------------------------------
McManCSU's Profile:

http://www.excelforum.com/member.php...o&userid=24379
View this thread: http://www.excelforum.com/showthread...hreadid=391781



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA and Constructors; exist?


Is there a way to do this auto constructor and pass in arguments?

ie: cktbd as new CircuitBoard (size, side

--
McManCS
-----------------------------------------------------------------------
McManCSU's Profile: http://www.excelforum.com/member.php...fo&userid=2437
View this thread: http://www.excelforum.com/showthread.php?threadid=39178

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBA and Constructors; exist?

No, there is only one class constructor and it takes no
arguments.


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


"McManCSU"
wrote in
message
...

Is there a way to do this auto constructor and pass in
arguments?

ie: cktbd as new CircuitBoard (size, side)


--
McManCSU
------------------------------------------------------------------------
McManCSU's Profile:
http://www.excelforum.com/member.php...o&userid=24379
View this thread:
http://www.excelforum.com/showthread...hreadid=391781



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
Check for a tab if it is exist Farhad Excel Discussion (Misc queries) 2 December 21st 08 07:31 PM
Exist or Not. ldiaz Excel Discussion (Misc queries) 3 September 6th 06 09:31 PM
Am I Looking For Something That Doesn't Exist? seanryann Excel Discussion (Misc queries) 11 April 1st 06 06:10 PM
Does a book like this exist? Ed[_9_] Excel Programming 3 November 20th 03 04:25 PM
Does sheet exist? Sean Evanovich Excel Programming 2 November 19th 03 02:30 PM


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