Dear All
I use the lastest version of POI(3.1) to create 1400 sheets in a
workbook. And when I open the XLS file generated by the programe, the MS
excel 2003 pops the error like bellow.
"Damage to the file was so extensive that repairs were not possible.
Excel
attempted to recover your formulas and values, but some data may have been
lost or corrupted."
code :
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class Test {
public static void main(String[] args) {
FileOutputStream fs = null;
try {
fs = new FileOutputStream("test.xls");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
HSSFWorkbook wb = new HSSFWorkbook();
String sheetName = "s";
for(int i=0;i<2000;i++){
sheetName = sheetName + i;
wb.createSheet(sheetName);
sheetName = "s";
System.out.println("sheet of number " + i +
"finish!!!");
}
try {
wb.write(fs);
fs.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("finish!!");
}
}
And if the number of sheet is under 1370 or open it with EIOffice(a
office programe like ms office) even it more than 1400 sheets, it can be
opened normally. Can anyone of you tell me why?
Thanks in advance for your help!
Andy
--
View this message in context:
http://www.nabble.com/the-maximum-number-of-sheets-can-create-in-one-workbook--tp18705761p18705761.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]