File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Priya Sri
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very sorry...the code there is actually like this:
excelFile = File.createTempFile("MyExcel1", ".xls",new File("C:\"));
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic