If you want to use the running excel object. You can use the following function:
        private void getExcelApp()
        {
            try
            {
                objXlApp = (excel.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application");
            }
            catch
            {
                objXlApp = new excel.Application();
            }
        }
 
 
No comments:
Post a Comment