Microsoft.Office.Interop.Excel.Application exApp = null; try { exApp = (Microsoft.Office.Interop.Excel.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application"); } catch (Exception err) { MessageBox.Show("no excel running, starting new one"); } if (!exApp.Visible) { exApp = new Microsoft.Office.Interop.Excel.Application(); }
if (!exApp.Visible){ exApp = new Microsoft.Office.Interop.Excel.Application();}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)