ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Property Let / Get Statements (https://www.excelbanter.com/excel-programming/314008-property-let-get-statements.html)

John

Property Let / Get Statements
 
Is it possible to store arrays in property prpcedures? Specifically -
array's of unknown size?

I tried using ParamArray, but it won't compile (even though MS Help says you
can use it):
-----------------------------------------------------------------------------
Public Property Let FileNames(ParamArray vNewValue() As Variant)
....
End Property
-----------------------------------------------------------------------------
I also tried:
Public Property Let FileNames(ByRef vNewValue() As Variant)
....
End Property

John

Myrna Larson

Property Let / Get Statements
 
With ParamArray, you would have to list each and every one of the elements of
the array in your assignment statement, i.e. something like this:

FileNames = "Text1", "Text2", "Text3"

In looking at the data types which can be used with Property Let, I don't see
arrays mentioned. But I expect it will work if you store your array in a
variant or user-defined type. That said, I couldn't get it to work with a UDT,
but the variant worked.

On Tue, 19 Oct 2004 08:35:02 -0700, "John"
wrote:

Is it possible to store arrays in property prpcedures? Specifically -
array's of unknown size?

I tried using ParamArray, but it won't compile (even though MS Help says you
can use it):
-----------------------------------------------------------------------------
Public Property Let FileNames(ParamArray vNewValue() As Variant)
...
End Property
-----------------------------------------------------------------------------
I also tried:
Public Property Let FileNames(ByRef vNewValue() As Variant)
...
End Property

John




All times are GMT +1. The time now is 07:06 PM.

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