Hi..i was also using this approach to close the browsers. I used to get same error some times. I dont think u would get this everytime u run...
Then i started using below method which works gr8 w/o any issue.. I am not sure of your requirement. If u just need to close all IEs, try this.
SystemUtil.CloseProcessByName("iexplore.exe")
Then i started using below method which works gr8 w/o any issue.. I am not sure of your requirement. If u just need to close all IEs, try this.
SystemUtil.CloseProcessByName("iexplore.exe")