You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Yegor Kozlov <ye...@dinom.ru> on 2012/03/01 08:26:01 UTC

Re: InvalidOperationException:Can't open specified file

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 <ji...@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


Re: InvalidOperationException:Can't open specified file

Posted by jiteshks <ji...@yahoo.com>.
Thanks Yegor - it works now.
But it is too slow.Takes 3 minutes to just load the spreadsheet.Keeping user
waiting for 3 minutes won't be acceptable.
Any solutions for that?

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/InvalidOperationException-Can-t-open-specified-file-tp5524067p5529084.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