File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
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: 41123
    
  45
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).


Ping & DNS - my free Android networking tools app
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: 41123
    
  45
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
File Not Found Exception Occurred while using JXL API
copy workbook(xls) using xls
Download it in different sheets in Excel
Need Required Java Code to Store Data directly into Excel File
error : upload excel file