Hi all,

Could anyone please check my sample code because I can't see the final result?

Private Sub Form1_Load()
Call AnyNumberArguments
Call AnyNumberArguments(1)
Call AnyNumberArguments(2, 3)
Call AnyNumberArguments(4, 5, 6)
Call AnyNumberArguments(7, 8, 9, 10, 11, 12)
End Sub


Private Sub AnyNumberArguments(ParamArray x() As Variant)
Dim y As Integer

Print "Procedure AnyNumberArguments received:"
For y = LBound(x) To UBound(x)
Print x(y) & Space$(4);
Next y

Print

End Sub

Best Regards,

Octavia

call the function from some other event expect form_load.

try it inside of a command button click event.

it will work.

regards
Shouvik

Hi choudhuryshouv,

I had already tested that method before. I could see the result.
I also used 'Debug.Print' to do the testing. These two methods can see the result, but I really don't know why we can print out while starting 'Form_Load'.

Thanks,
Octavia

make the last print command inside ur function body commented.

and one more thing, i have already tried your code in my system, it worked smoothly and displayed the following result :-

Procedure AnyNumberArguements received:
Procedure AnyNumberArguements received:
1 Procedure AnyNumberArguements received:
2 3 Procedure AnyNumberArguements received:
4 5 6 Procedure AnyNumberArguements received:
7 8 9 10 11 12

regards
Shouvik

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.