LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Help with paramarray

I have a class with a method that essentially creates a new object of
the same type with the same contents. Since I may want to omit one or
more of the source instance's contents, I have a paramarray argument in
there, and basically, if one of the items exists in the passed array,
it gets skipped and not copied.

Now, I've gone from specifying the excluded items as a list in the
arguments to creating an array of excluded items. I figured that this
would work the same way, but for some reason, the method is getting an
array where the first element is also an array (which is the element I
want).

Here is my crappy code:

Public Function Replicate( _
ParamArray Exclude() As Variant) As Factors

Dim fct As New Factors
Dim lngIndex As Integer
Dim varNames As Variant
Dim varFactors As Variant
Dim varIgnore As Variant

varNames = pDict.Keys
varFactors = pDict.Items
varIgnore = Exclude
For lngIndex = 0 To pDict.Count - 1

If Not IsElementOf(CStr(varNames(lngIndex)), varIgnore) Then

fct.Add CStr(varNames(lngIndex)), CCur(varFactors(lngIndex))

End If

Next lngIndex

Set Replicate = fct

End Function

Any idea what I'm doing wrong?

 
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
ParamArray Jim Chandler[_2_] Excel Programming 4 April 28th 04 03:28 PM


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