I am trying to use InvokeMember to call a function from some code I am compiling on the fly. If I turn Option Strict off and just call the method, it works no problem, so I am guessing there is just something wrong with my InvokeMember call:

VB Code:
  1. Dim oClass As Object
  2.             Dim tType As Type
  3. 'cResult is an assembly that is compiled from the code that I load from a file
  4.             oClass = cResult.CompiledAssembly.CreateInstance("clsScripting")
  5.             tType = cResult.CompiledAssembly.GetType("clsScripting")
  6.  
  7.             Dim oArguments(1) As Object
  8.             oArguments(0) = m_App
  9.  
  10.             'oClass.customcode(m_App)
  11.             tType.InvokeMember("CustomCode", Reflection.BindingFlags.Default Or BindingFlags.InvokeMethod, Nothing, oClass, oArguments)

Here is the code it is compiling:
VB Code:
  1. Class clsScripting
  2.     Public Sub CustomCode(ByVal objWord As Object)
  3.         objWord.Selection.TypeText("A")
  4.     End Sub
  5. End Class

Any help would be appreciated.

Thanks,