private void frmMain_Closing(object sender, CancelEventArgs e)
{
if( thread != null )
{
thread.Abort( );
thread.Join( );
}
if( this.excel != null )
{
this.excel.Dispose( );
}
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

private void Dispose(bool disposing)
{
if(disposing)
{
this.excel.Quit( );
}
}