ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Duplicated occurrences of class variables - VBA in Excel (https://www.excelbanter.com/excel-programming/350063-duplicated-occurrences-class-variables-vba-excel.html)

vmegha

Duplicated occurrences of class variables - VBA in Excel
 


Hi,


I'm using Get and Let methods on an Objects Private Variables called
for eg: OrdSettleDate , etc in my VBA App.


In my debug mode, when I watch the built up object I see two
occurrences of the variables, in the object - OrdSettleDate and
SettleDate


Here're are the let and get methods-


Property Get SettleDate() As String
SettleDate = OrdSettleDate
End Property


Property Let SettleDate(ByVal SettleDate As String)
OrdSettleDate = SettleDate
End Property


Is this normal behaviour?


Any help , will be appreciated,
Thanks,
Megha


Bob Phillips[_6_]

Duplicated occurrences of class variables - VBA in Excel
 
I am not sure what problem you are experiencing, but I don't seem to get a
problem with that code.

I personally wouldn't use the same name for a property and its argument as
you do in the Property Let, I would use something like

Property Let SettleDate(ByVal InputDate As String)
OrdSettleDate = InputDate
End Property

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"vmegha" wrote in message
oups.com...


Hi,


I'm using Get and Let methods on an Objects Private Variables called
for eg: OrdSettleDate , etc in my VBA App.


In my debug mode, when I watch the built up object I see two
occurrences of the variables, in the object - OrdSettleDate and
SettleDate


Here're are the let and get methods-


Property Get SettleDate() As String
SettleDate = OrdSettleDate
End Property


Property Let SettleDate(ByVal SettleDate As String)
OrdSettleDate = SettleDate
End Property


Is this normal behaviour?


Any help , will be appreciated,
Thanks,
Megha





All times are GMT +1. The time now is 05:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com