C# Class Smrf.AppLib.ExcelApplicationKiller

Kills an Excel application's process on demand.
The KillExcelApplication method kills the process running an Excel application. It can be used to guarantee that an Excel application started from a parent process is removed from memory when the parent process is done with the Excel application.

There are various situations in which calling Application.Quit() will not remove the Excel application from memory; see this posting for more information:

http://www.dotnet247.com/247reference/msgs/68/344322.aspx

Suggested solutions involving calls to Marshall.ReleaseComObject(), never referencing an Excel object more than one level deep without storing it in an intermediate variable, and so on, are either unreliable or fragile and grossly impractical. This class offers a brute-force workaround for all those problems.

Inheritance: Object
Afficher le fichier Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Свойство Type Description
m_iProcessID System.Int32

Méthodes publiques

Méthode Description
ExcelApplicationKiller ( Microsoft visibleExcelApplication ) : System

Initializes a new instance of the ExcelApplicationKiller class.

KillExcelApplication ( ) : void

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

ExcelApplicationKiller() public méthode

Initializes a new instance of the ExcelApplicationKiller class.
public ExcelApplicationKiller ( Microsoft visibleExcelApplication ) : System
visibleExcelApplication Microsoft /// The Excel application that will be killed by . The application must be visible. ///
Résultat System

KillExcelApplication() public méthode

public KillExcelApplication ( ) : void
Résultat void

Property Details

m_iProcessID protected_oe property

protected Int32,System m_iProcessID
Résultat System.Int32