Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tetsuya Oguma
 
Posts: n/a
Default How to cycle through each of property and its value of Class?

Hi all,

I just wonder a way to go through all the properties and each value.

I have a Class called clsFund and in it:
++++
Dim m_szName As String
Dim m_szID As String

Property Let pName(szName As String)
m_szName = szName
End Property

Property Get pName() As String
pName = m_szName
End Property

Property Let pID(szID As String)
m_szID = szID
End Property

Property Get pID() As String
pID = m_szID
End Property
++++

Then I want a For Each... loop like method to invoke in order to cycle
through each property (pName and pID) and it's value!

Thanks for your time.
---
Tetsuya Oguma, Singapore
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How to cycle through each of property and its value of Class?

There is no built-in to list all the properties and methods of a class. You
would need to write something that read the class module and extracted it.

You can get it via Intellisense. Write some code that references the class,
then type the class object name and a . (dot) and the intellisense drop-down
shows you all the properties and methods.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Tetsuya Oguma" wrote in message
...
Hi all,

I just wonder a way to go through all the properties and each value.

I have a Class called clsFund and in it:
++++
Dim m_szName As String
Dim m_szID As String

Property Let pName(szName As String)
m_szName = szName
End Property

Property Get pName() As String
pName = m_szName
End Property

Property Let pID(szID As String)
m_szID = szID
End Property

Property Get pID() As String
pID = m_szID
End Property
++++

Then I want a For Each... loop like method to invoke in order to cycle
through each property (pName and pID) and it's value!

Thanks for your time.
---
Tetsuya Oguma, Singapore



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



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