Try checking the namedRange.getReference() is not still referencing the deleted sheets.

I believe the getSheetName() refers to the 'owning' sheet of named range. So even though you are altering which sheet owns the named ranges the named range references are still probably referring to the deleted sheets (e.g 'Deleted_Sheet1'!A1:A15)


nupur wrote:
I am actually setting the refrences for the named ranges to one of the active
sheets in the excel.


Tim Wilkins wrote:
Have you tried deleting all named ranges that refer to the sheets that you delete?

HSSFName.getSheetName()

nupur wrote:
am using POI for generating excel reports.
The requirement is to write to a template, consisting of several sheets.
Each sheet in this template corresponds to different type of reports. After writing to the template, we check for the reports requested by the
user; and whatever reports are not requested, we delete the corresponding
sheets in the template and save it in a specified location.

Now the problem is if we delete a sheet, which has some named ranges,
using
POI; while opening the generated excel I get an error-
Removed one or more invalid names.

Please respond if anyone has faced a similar issue as it is really
urgent.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to