This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Writing to EXCEL -- Workbook.write() not working Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "Writing to EXCEL -- Workbook.write() not working" Watch "Writing to EXCEL -- Workbook.write() not working" New topic
Author

Writing to EXCEL -- Workbook.write() not working

Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
Hi all,

I am trying to write some data to an excel using the below code. The data in MyExcel1 can be found in the variable "copy". But is not getting written to MyExcel2.xls
Please help !!



Regards,
Priya Sri
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
It doesn't look like the code writes to MyExcel2.xls. It writes to whatever is returned in line 2. I'm not sure what that would be - java.util.File has no method called createTempFile(String).


Android appsImageJ pluginsJava web charts
Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
Very sorry...the code there is actually like this:
excelFile = File.createTempFile("MyExcel1", ".xls",new File("C:\"));
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
OK, so that confirms it - nothing would get written to MyExcel2.xls.

Why are you using createTempFile instead of "new File"?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing to EXCEL -- Workbook.write() not working
 
Similar Threads
Need Required Java Code to Store Data directly into Excel File
copy workbook(xls) using xls
File Not Found Exception Occurred while using JXL API
Download it in different sheets in Excel
error : upload excel file