<p>I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter.
The function looks like this: </p>

<pre><code>Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = "45") as boolean
'stuff
end function
</code></pre>

<p>and I'm Invoking it like this:</p>

<pre><code>Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, "DoSomeStuff", Param1, Param2, Param3)
</code></pre>

<p>This works fine, other than when I don't pass the third (optional) parameter, it dosn't hit the function.</p>

<pre><code>Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, "DoSomeStuff", Param1, Param2)
</code></pre>

<p>Is there a way I can use Reflector.invokeMethod to call this function without passing the optional parameter? or another way to achieve this?</p>

I would overload the
DoSomeStuff
method rather than use an optional parameter...
```
```
Private Overloads Function DoSomeStuff(ByVal blah1 As String, ByVal blah2 As String) As Boolean
    Return DoSomeStuff(blah1, blah2, "45")
End Function

Private Overloads Function DoSomeStuff(ByVal blah1 As String, ByVal blah2 As String, ByVal blah3 As String) As Boolean
    'stuff
End Function
```
```