I am creating a workbook in a Struts action and streaming it to the browser using the following snippet: // execute the ExcelQuery and write the results to the stream if (excelquery != null) { HSSFWorkbook wb = excelquery.getWorkbookSQL(user, messages); ServletOutputStream stream = response.getOutputStream(); String fileName = selectedQuery + ".xls"; response.setHeader( "Content-Disposition", "attachment; filename=\"" + fileName + "\""); response.setContentType("application/vnd.ms-excel"); wb.write(stream); stream.flush(); stream.close(); return (null); } The user sees a File Download dialog that allows them to Open or Save the Excel file. Either choice works GREAT in W2000/Office2000, XP/OfficeXP, but causes an Excel error in Win98/Excel97 SR-2. The error says: EXCEL caused an invalid page fault in module EXCEL.EXE at 0177:300fa329. If I take the offending xls to another computer, XP or 2000 can open the xls just fine. I can save the xls back to the Win98 pc and open it normally in Excel97. I will attach an example (when I figure out how) of an xls that I can't open and the same one after it has been opened/saved using Excel XP. Any assistance would be greatly appreciated! This is a critical project. Thank you very much, Kendall
Created attachment 3404 [details] Causes error in Excel 97 when opened
Created attachment 3405 [details] Can open this in Excel 97 without error
not only do I not see anything wrong with the file in BiffViewer (org.apache.poi.hssf.dev.BiffViewer) but my copy of Excel97 opens it just fine. You should discuss this on the poi-user list perhaps someone else has experienced a similar problem.