title: C# Com OLE Server
body: <p>I am trying to figure out the best way to interact with an OLE Server using C# .NET</p>
  
  <p>i have found some code that enables interaction with COM+ that appears to work for the OLE server but I wonder if there is a more elegant or simpler way? </p>
  
  <p>I require that it be late bound.</p>
  
  <p>Code (as pilfered from elsewhere on the net)</p>
  
  <pre><code>// Code start
  Type excel;
  object[] parameter = new object[1];
  object excelObject;
  try
  {
      //Get the excel object 
      excel = Type.GetTypeFromProgID("Excel.Application");
  
      //Create instance of excel 
      excelObject = Activator.CreateInstance(excel);
  
      //Set the parameter whic u want to set 
      parameter[0] = true;
  
  
      //Set the Visible property 
      excel.InvokeMember("Visible", BindingFlags.SetProperty, null, excelObject, parameter);
  </code></pre>
  
  <p>Obviously in my case I am putting the name of my ole server in where Excel.Application is, but I have seen cases in EARLY binding where you can call the function directly off the object without having to go via 'InvokeMember'</p>
  
  <p>Is this possible? Can I use Type to cast as object as my type?</p>
  
  <p>Thanks.</p>