poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Kozlov <yegor.koz...@dinom.ru>
Subject Re: InvalidOperationException:Can't open specified file
Date Thu, 01 Mar 2012 07:26:01 GMT
You must close streams on the server side. Change your code as follows:

FileInputStream is = new FileInputStream(filePath))
XSSFWorkbook workbook = new XSSFWorkbook(is);
is.close();

Yegor

On Wed, Feb 29, 2012 at 10:04 PM, jiteshks <jiteshks@yahoo.com> wrote:
> I have tried both these versions :-
>
> XSSFWorkbook workbook = new XSSFWorkbook(filePath); //deprecated
>
> and
>
> XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(filePath));
>
> Both throw the same error.
>
> --
> View this message in context: http://apache-poi.1045710.n5.nabble.com/InvalidOperationException-Can-t-open-specified-file-tp5524067p5525661.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
>

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


Mime
View raw message