https://issues.apache.org/bugzilla/show_bug.cgi?id=47559
Summary: POI generated xlsx files are not compatible with Excel
2008 Mac SP2
Product: POI
Version: 3.5-dev
Platform: PC
OS/Version: Mac OS X 10.4
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=24020)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24020)
sample file generated by POI that is unreadable by Excel 2008 SP2
After upgrading to Excel 2008 SP2 for Mac, Excel is no longer able to read xlsx
files generated by poi. I am including an email thread with Microsoft relating
to this. I'm not sure if this is a POI issue, or a Microsoft one, but I wanted
to document it here.
--Leif
===== EMAIL THREAD START ====
Pat-
Thanks for the response. The solution of using windows excel won’t work for
us, as we have a batch system that generates literally thousands of excel files
on a weekly basis that get distributed to users across our organization. The
batch system runs on linux-based servers. This “sudden” breaking of excel is
really an issue for us, especially with the automatic updating of excel. A
quick and speedy resolution of this problem would help much. If there are any
more details on the specifics of the contents of the xlsx file that Excel 2008
SP2 cannot read, it might be possible to change our excel generator to tweak
the xlsx files we generate. I compared the contents of the “fixed” version (
windows->xlsb->xlsx) to the “incompatible” version by unzipping and comparing
the contents of the embedded xml files. But there are may differences. Do you
know what it is about the sample I sent you that Excel Mac doesn’t like?
Thanks much,
--Leif
On 7/22/09 3:52 PM, "Patrick McMillan (MACBU)" <[email protected]> wrote:
Hi Leif,
There’s some explanation for the cause of this at this link:
http://support.microsoft.com/kb/972141. Basically, files that were generated in
specific ways in particular versions of Windows Excel (for example, by opening
a text file) and then saved to the .xlsx format will have this problem. We’re
working on a solution to this problem, but in the meantime, if you have access
to Windows Excel, you should be able to “fix” affected files by opening them in
Windows Excel, saving out as .xlsb, and then saving them again as .xlsx. At
that point, the files should open fine in Mac Excel again.
Please let me know if that works for you.
Thanks,
Pat
On 7/22/09 2:06 PM, "Leif Nelson" wrote:
Hi Pat-
I saw your posting on the Excel forum (
http://www.officeformac.com/ms/ProductForums/Excel/4544 ), and thought I could
send you one of the files that I cannot open. For our business systems, we
generate xlsx files programmatically with Java using apache POI and their new
xlsx support. We have been happily using this for several months now with
awesome results on Mac and Windows platforms for distributing our business
data. Well, after the SP2 update, ALL of the files we generate are now unable
to be opened by Excel 2008 for Mac. This is a huge issue for us. I have
generated the simplest excel file possible. It works with Excel 12.1.9 and
Excel 2007 for windows. For completeness, here’s the java code I’m using to
generate the xlsx file:
Thanks much,
Leif Nelson
package org.apache.poi.xssf.util;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class PoiTest {
public static void main(String[] args) {
try {
XSSFWorkbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);
Cell cell = row.createCell(0);
cell.setCellValue("Hi there");
OutputStream out;
out = new FileOutputStream(new File("testout.xlsx"));
wb.write(out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
===== EMAIL THREAD END ======
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]