Beispiel #1
0
 public void SaveAndCleanUp()
 {
     try
     {
         if (XLPackage != null)
         {
             XLPackage.Save();
             XLPackage.Dispose();
             XLPackage = null;
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     Process[] deathList = Process.GetProcessesByName("excel");
     try
     {
         for (int i = 0; i < deathList.Length; i++)
         {
             deathList[i].Close();
             //deathList[i].Kill();
         }
     }
     catch (Exception ex)
     {
         throw new ExternalException("There was a problem killing the running excel processes, " + ex.Message, ex);
     }
 }
Beispiel #2
0
 public void Close()
 {
     try
     {
         if (XLPackage != null)
         {
             XLPackage.Dispose();
             XLPackage = null;
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }