Thanks for the rapid replay AND ANSWER. I am using .Net 2005 and I am including a code snippet for anyone else who may have a need to do this. I am using Word but it should work for Excel.
Ray
Microsoft.Office.Interop.Word.Application app = null;
try
{
app = (Microsoft.Office.Interop.Word.Application)System.Runtime.InteropServices.Marshal.GetActiveObject ("Word.Application");
}
catch (Exception)
{
app = null;
}
if (app == null)
{
app = new Microsoft.Office.Interop.Word.Application ();
app.Visible = true;
}
|