I try to close my browser in C# using the following code:
private void KillIE()
{
ShellWindows winShells = new ShellWindowsClass();
foreach (InternetExplorer Browser in winShells )
{
Browser.Quit();
}
}
Sometimes its works but today it doesn't and I cant get it to work. Now all I get is the following message.
Error HRESULT E_FAIL has been returned from a call to a COM component.
Anyone have any clue why this is happening?