× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I posted earlier on this subject & can not get any success. I am trying
to delete a sheet from an existing xls spreadsheet. Scott Klement's HSSF
code does not have a Remove sheet, so I thought I would create my own. I
came up with the code below to remove the sheet called 'rmreports', but it
does not remove it. Is there some place that I can see why it isn't
deleting it? I have looked in the joblog & all I see is Java Virtual
Machine is IBM Technology for Java. PID(242474) No errors reported & the
program seems to run fine. If I run the code through debug, the sheet
index is 1 - there are 2 sheets in the xls, so that seems to be correct.

Thanks
Steve Jones
H-P Products, Inc

H OPTION(*SRCSTMT: *NODEBUGIO: *NOSHOWCPY)
H THREAD(*SERIALIZE)
H BNDDIR('HSSF')
/copy hssf_h

d Remove_Sheet Pr
d SheetIndex like(jint)

d book s like(SSWorkbook)
d Sheet s like(SSSheet)
d SheetIndex s like(jint)

/free
ss_begin_object_group(100);
book =
ss_open('/QNTC/HPIA/ixaadmin/Global/IXAADMIN/MyReport.xls');
sheet = ss_getSheet(book: 'rmreports');
SheetIndex = SS_find_sheet(book:Sheet);
Remove_Sheet(SheetIndex);
ss_save(book: '/QNTC/HPIA/ixaadmin/Global/IXAADMIN/MyReport.xls');
ss_end_object_group();
*Inlr = *on;

/end-free

p Remove_Sheet B
d Remove_Sheet PI
d SheetIndex like(jint)
d removeSheetAt PR like(SSSheet)
d EXTPROC(*JAVA
d
:'org.apache.poi.hssf.usermodel-
d .HSSFWorkbook'
d :'removeSheetAt')
d SheetIndex Like(jint) value
p E


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.