You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Raghav <ra...@altair.com> on 2007/05/18 11:47:00 UTC

Want to save a excel file after opening it

Hi Experts,

I am reading a excel file from my file system (E:/myFile.xls) using the POIFS
package. Using the POI package for excel, I modify the contents of this file.

My question here is, how do I save back this same file to the file system. I am
not able to get the writing stream to this because it is still open by POIFS.

The code goes like this:
POIFSFileSystem fs = new POIFSFileSystem( 
		           new FileInputStream( "E:/myFile.xls"));	 	        

// AFter this I modify the file and then want to save this excel file, please
let me know how can I do this


Thanks in advance
Raghav 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Want to save a excel file after opening it

Posted by Nick Burch <ni...@torchbox.com>.
On Fri, 18 May 2007, Raghav wrote:
> My question here is, how do I save back this same file to the file 
> system. I am not able to get the writing stream to this because it is 
> still open by POIFS.

Call write on your workbook:
http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html#write(java.io.OutputStream)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/