• Post Reply Bookmark Topic Watch Topic
  • New Topic

file Writing problem

 
Ravikanth thota
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone,

i am working with Excel workbook using apache POI API.After writing the data into the workbook the size of the file is reducing and the file is getting corrupted it has shown an error like:

"Excel Found Unreadable Content in FILENAME.xlsx. do you want to recover the content of this workbook?If you trust the source of this workbook click yes! "

i am attaching my code



please help me in finding the error..!!!
 
Sudhir Ravindra
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you are trying to add content to an existing work book. Which version of excel was this sheet created in.
Try creating a new workbook as described in http://poi.apache.org/spreadsheet/quick-guide.html#CreateCells and see if you can reproduce the issue.
 
Ravikanth thota
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhir Ravindra wrote:Looks like you are trying to add content to an existing work book. Which version of excel was this sheet created in.
Try creating a new workbook as described in http://poi.apache.org/spreadsheet/quick-guide.html#CreateCells and see if you can reproduce the issue.


i am using Microsoft 2010 excel. my code is working fine with .xls files(till Microsoft 2007). but for .xlsx files, after writing into excel, if we try to open excel it is showing error as i mentioned above..
 
Ishmeet Kaur
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, were you able to solve this issue?

I am having the same problem when I try to create an Excel sheet using Apache POI.
 
Tony Docherty
Saloon Keeper
Posts: 3138
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this will help but I've always used the WorkBookFactory to create the WorkBook ie:

If this doesn't help can you show the code you are using.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!