I have a web report which is done using JSP & HTML

Sujatha Gopal

var wind="";
function OpenExcel()

function closeWin() 
  if (wind && wind.open && !wind.closed) wind.close();
Call the OpenExcel function on OnClick of the anchor tag
(a href="javascript:void()" onclick="return OpenExcel()")OPen Excel(/a)

Invoke the closeWin function on Unload Event of the Body Tag.
The excel sheet gets closed automatically on navigating to other pages.

Hope this will help to close the excel sheet

Have to use methods of java.io to find file already exists and to delete the file