aspose 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
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: 42934
    
  68
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).
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: 42934
    
  68
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