It works fine with us. What POI-Version are u using? I remember some issues with macros in some versions of poi. Also we are using another constructor in HSSFWorkbook which is preserving nodes: POIFSFileSystem pfs = new POIFSFileSystem(new ByteArrayInputStream(template)); wb = new HSSFWorkbook(pfs, true);
HTH, Karsten. -----Ursprüngliche Nachricht----- Von: news [mailto:[EMAIL PROTECTED] Im Auftrag von Maciek Gesendet: Montag, 16. Januar 2006 09:57 An: [email protected] Betreff: Writing to excel template wipes out macros Hi. I have a problem rewriting excel template. Our template contains macros that generate charts, we want to insert data into it. But after writing to this template, macros are wiped out. I tried to write new cells and to read cells and alter their contents, with same effect - no macros survives this operation. Is their any special api to alter sheet content, so that macros will remain functional ? Code that reads template: ... POIFSFileSystem pfs = new POIFSFileSystem(new ByteArrayInputStream (template)); wb = new HSSFWorkbook(pfs); sheet = wb.getSheet(DATA_SHEET_NAME); meta = wb.getSheet(META_SHEET_NAME); ... I know that it is possible to read template containg macros and charts, and alter its dats without destroing macros. However, I haven't been able to find any example :( Thanks in advance. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
