Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Setting a collection in a class

I have a class (Task) with a collection property (SubTask) (which is a
collection of another class). I have my Let statement as below, but when I
try to make the call to set the property with a collection, I get an invalid
use of property error upon compiling. Anyone know what I am doing wrong?
Thanks.

'This line doesn't work in a separate method
Set Task.SubTasks = colTasks

'Class Property
Private pSubtask As New Collection

'let statement
Property Let SubTasks(S As Collection)
Set pSubtask = S
End Property

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Setting a collection in a class

Roedd <<J Streger wedi ysgrifennu:

I have a class (Task) with a collection property (SubTask) (which is a
collection of another class). I have my Let statement as below, but
when I try to make the call to set the property with a collection, I
get an invalid use of property error upon compiling. Anyone know what
I am doing wrong? Thanks.

'This line doesn't work in a separate method
Set Task.SubTasks = colTasks

'Class Property
Private pSubtask As New Collection

'let statement
Property Let SubTasks(S As Collection)
Set pSubtask = S
End Property


Property Let SubTasks

should be

Property Set SubTasks

--
Rob

"We live in a decaying age. Young people no longer respect their
parents. They are rude and impatient. They frequently inhabit taverns
and have no self control". (Inscription, 6,000 year-old Egyptian tomb)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Setting a collection in a class

J,

Use Set instead of Let

Property Set SubTasks(S As Collection)
Set pSubtask = S
End Property


--
Hope that helps.

Vergel Adriano


"J Streger" wrote:

I have a class (Task) with a collection property (SubTask) (which is a
collection of another class). I have my Let statement as below, but when I
try to make the call to set the property with a collection, I get an invalid
use of property error upon compiling. Anyone know what I am doing wrong?
Thanks.

'This line doesn't work in a separate method
Set Task.SubTasks = colTasks

'Class Property
Private pSubtask As New Collection

'let statement
Property Let SubTasks(S As Collection)
Set pSubtask = S
End Property

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Setting a collection in a class

*smacks forehead*

Thank you...*puts on his stupid sign*

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003



"J Streger" wrote:

I have a class (Task) with a collection property (SubTask) (which is a
collection of another class). I have my Let statement as below, but when I
try to make the call to set the property with a collection, I get an invalid
use of property error upon compiling. Anyone know what I am doing wrong?
Thanks.

'This line doesn't work in a separate method
Set Task.SubTasks = colTasks

'Class Property
Private pSubtask As New Collection

'let statement
Property Let SubTasks(S As Collection)
Set pSubtask = S
End Property

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

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
Wrapping a Collection Class Bing Excel Programming 5 December 24th 04 11:37 AM
Need Class Collection advice R Avery Excel Programming 3 April 6th 04 10:34 AM
Collection Class problems Flemming Dahl Excel Programming 4 February 11th 04 04:41 PM
RaiseEvent from a class contained in a 2nd class collection? Andrew[_16_] Excel Programming 2 January 6th 04 04:22 PM
For/Each iteration for collection class Stelio Excel Programming 1 October 31st 03 12:46 PM


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