poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From java_lee <lizhensp...@hotmail.com>
Subject Re: the maximum number of sheets can create in one workbook?
Date Tue, 29 Jul 2008 06:41:26 GMT

I am sure that it is not the limitation of the memory. Because when i use the
EIOffice open it and save as a different file, the size is not change ,but I
can read it with Excel 2003.



Anthony Andrews wrote:
> 
> There is no upper limit on the number of worksheets that you can have
> within a workbook as far as Excel is concerned - Microsoft will only say
> that the maximum number of sheets is limited by the amount of memory you
> have on the machine. However, if I remember correctly, when it opens a
> workbook, Excel creates a temporary file for each worksheet. Therefore,
> you may be hitting some limit on your system - it may simply not have
> sufficient resources to create and hold open all of those temporary files.
> 
> --- On Mon, 7/28/08, java_lee <lizhenspace@hotmail.com> wrote:
> From: java_lee <lizhenspace@hotmail.com>
> Subject: the maximum number of sheets can create in one workbook?
> To: user@poi.apache.org
> Date: Monday, July 28, 2008, 10:45 PM
> 
> 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: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
>       
> 

-- 
View this message in context: http://www.nabble.com/the-maximum-number-of-sheets-can-create-in-one-workbook--tp18705761p18706349.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message