This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Using HSSFWorkbook to copy excel file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Using HSSFWorkbook to copy excel file" Watch "Using HSSFWorkbook to copy excel file" New topic
Author

Using HSSFWorkbook to copy excel file

daphna deutsch
Greenhorn

Joined: Nov 17, 2005
Posts: 17
Hi,

The program bellow creates a copy of an excel file.
I am using the HSSFWorkbook object because i need to change information on the new file.
The problem is that an object that was created in the original file lost its focus on the copied file.
For example, I add a power point object in the original file, and in the copied file i can see the object, but clicking on it reveals the error message "cannot start the source application for this object"

Does anyone know this problem?



FileInputStream fileIn = null;
FileOutputStream fileOut = null;
try{
String xlsFileName = "D:/i3/32_100006.xls";
String xlsFileNameCopy = "D:/i3/Copy32_100006.xls";
fileIn = new FileInputStream(xlsFileName);
POIFSFileSystem fs = new POIFSFileSystem(fileIn);
HSSFWorkbook wb = new HSSFWorkbook(fs);

/* change the file*/

fileOut = new FileOutputStream(xlsFileNameCopy);
wb.write(fileOut);
fileOut.close();
}
 
wood burning stoves
 
subject: Using HSSFWorkbook to copy excel file
 
Similar Threads
Using HSSFWorkbook to copy excel file
excel
java program for pdf file to excel file conversion
Updating excel spreadsheet
jsp with POI FILE System concept.