• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error in POI

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am working with Excel using POI API.I need to read an excel file and do some modifications and save this file into different location. Along with this I need to remove the extra sheets which is not used by the program. For this I wrote a method inside calling workbook.removeSheetAt(index). This works fine without any exception. The problem now is whenever I tried opened the newly created worksheet it is showing a Removed one or more invalid names repair message box.

how do i solve the problem

thanks in advanced.
 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have worked a little with POI and are you sure you are dealing with separate ExcelDocument objects here?

Cheers,
Raj.
 
Sylvia Crissy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raj,
No I didnt use different ExcelDocument Objects since I need to modify the existing file.
 
Rajkamal Pillai
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sylvia,

I need to read an excel file and do some modifications and save this file into different location. Along with this I need to remove the extra sheets which is not used by the program. For this I wrote a method inside calling workbook.removeSheetAt(index). This works fine without any exception.
The problem now is whenever I tried opened the newly created worksheet it is showing a Removed one or more invalid names repair message box.



How can you say it is working fine? Because after you do your modifications (including the deletion of unwanted worksheets) if you are not able to check the worksheet how can you say it is working?

My assumption is your modification of the worksheet is working ok and you are probably able to copy it to a new location too. But after deleting unwanted worksheets from the original document you are not able to open the second one?

My thought goes like this, since the two documents are two completely seperate entities why should a deletion of worksheets from one cause an error while opening the other? Unless they are related in some possible manner, which is why I asked the ExcelDocument question. May sound childlike but are you sure you are opening and closing the documents correctly?

Cheers,
Raj.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you written a little program that opens both files and prints out the names of all sheets? Do you notice anything unusual in that output?

My thought goes like this, since the two documents are two completely seperate entities why should a deletion of worksheets from one cause an error while opening the other? Unless they are related in some possible manner,...


They are related, in that the second document is the first one minus some sheets, saved under a different name, if I understand the question correctly.
 
Rajkamal Pillai
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,

What I meant by that is not about the content being similar or even same. I feel they are connected as in ExcelDocument or ExcelWorksheet or some other POI object being shared or common for these two files.

Cheers,
Raj.
 
Sylvia Crissy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,
I tried with a small program which print the sheet names of both the files. the old prints all the sheets while new one prints only modified sheet by deleting the blank sheet.

here is the repair message
Microsoft Excel File Repair Log

Errors were detected in file 'C:\Documents and Settings\Sylvia.ONTASHINDIA\My Documents\Sylvia\projects\hcris\trunk1.1\data\330064_2000-12-31_L.xls'
The following is a list of repairs:

Removed one or more invalid names.


 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[ UD: Please do not post unrelated questions to existing topics. That's called "hijacking" and is frowned upon. Start a new thread instead. ]
[ October 06, 2008: Message edited by: Ulf Dittmer ]
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic