You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by kavinhub <ka...@gmail.com> on 2012/08/22 09:50:27 UTC

POI, embed object in excel, cannot start the source application for this object

I'm using one template of excel file(2003) with embed object (word document
2003). However, after we get the output excel file, the embed object word
doc is not be able to open, with error message of "cannot start the source
application for this object". 

I've tried both poi3.6 and poi3.8. it's NOT working.

Very simple sample code as below:
//read the temaplate excel with embed object
String filePathIn = "templdate.xls";
fs = new POIFSFileSystem(new FileInputStream(filePathIn));
HSSFWorkbook wb = new HSSFWorkbook(fs);   
//write the templdate excel into output file
String filePathOut="out.xls";
FileOutputStream fileOut = new FileOutputStream(filePathOut);
wb.write(fileOut);   
fileOut.close();

After that, it's not  possible to open the embed object in the out.xls. Can
anyone help on this. Thanks.



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/POI-embed-object-in-excel-cannot-start-the-source-application-for-this-object-tp5710760.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


Re: POI, embed object in excel, cannot start the source application for this object

Posted by kavinhub <ka...@gmail.com>.
Thanks Nick for your quick response.

I've tried your approach as below and it seems not working.  Can you pls
help if there's anyother problem cuased this?

//read the temaplate excel with embed object 
String filePathIn = "templdate.xls"; 
fs = new POIFSFileSystem(new FileInputStream(filePathIn)); 
HSSFWorkbook wb = new HSSFWorkbook(fs*,ture*);   
//write the templdate excel into output file 
String filePathOut="out.xls"; 
FileOutputStream fileOut = new FileOutputStream(filePathOut); 
wb.write(fileOut);   
fileOut.close(); 






--
View this message in context: http://apache-poi.1045710.n5.nabble.com/POI-embed-object-in-excel-cannot-start-the-source-application-for-this-object-tp5710760p5710764.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


Re: POI, embed object in excel, cannot start the source application for this object

Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 22 Aug 2012, kavinhub wrote:
> Very simple sample code as below:
> //read the temaplate excel with embed object
> String filePathIn = "templdate.xls";
> fs = new POIFSFileSystem(new FileInputStream(filePathIn));
> HSSFWorkbook wb = new HSSFWorkbook(fs);

You probably want to pass the preserveNodes boolean in to the constructor, 
with the true flag:
http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html#HSSFWorkbook%28org.apache.poi.poifs.filesystem.DirectoryNode,%20boolean%29

Nick

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