java - Apache POI Enable excel editing -


i'm using apache poi edit excels in java. after editing poi not able save file because excel protected. if open, show option enable editing. on copying same file new excel work fine. there way enable editing java excel? here sample of code:

import java.io.file; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import java.util.iterator;  import org.apache.poi.ss.usermodel.cell; import org.apache.poi.ss.usermodel.row; import org.apache.poi.xssf.usermodel.xssfcell; import org.apache.poi.xssf.usermodel.xssfrow; import org.apache.poi.xssf.usermodel.xssfsheet; import org.apache.poi.xssf.usermodel.xssfworkbook;  public class test3 {     public static void main(string args[]) {         try {             fileinputstream file = new fileinputstream(new file(                     "new microsoft excel worksheet.xlsx"));             // document document = jsoup.connect("http://www.google.com").get();             // workbook instance xls file             xssfworkbook workbook = new xssfworkbook(file);             (int = 0; < workbook.getnumberofsheets(); i++) {                 // first sheet workbook                 xssfsheet sheet = workbook.getsheetat(i);                  // iterate through each rows first sheet                 iterator<row> rowiterator = sheet.iterator();                 while (rowiterator.hasnext()) {                     xssfrow row = (xssfrow) rowiterator.next();                      // each row, iterate through each columns                     iterator<cell> celliterator = row.celliterator();                      while (celliterator.hasnext()) {                         //                     }                  }             }             file.close();             fileoutputstream out = new fileoutputstream(                     "new microsoft excel worksheet.xlsx");             workbook.write(out);             out.close();             system.out.println("done!!!!!!!!");         } catch (filenotfoundexception e) {             e.printstacktrace();         } catch (ioexception e) {             e.printstacktrace();         }     } } 

i'm using excel 2007.


Comments

  1. Poi Explorer Game in UAE, Alliance Edition Game in UAE, Digital Media Game in UAE
    https://gccgamers.com/poi-explorer.html
    Poi Explorer Game in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee.
    1634789391072-10

    ReplyDelete
  2. Poi Explorer Game in UAE, Alliance Edition Game in UAE, Digital Media Game in UAE
    https://gccgamers.com/poi-explorer.html
    Poi Explorer Game in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee.
    1634796245910-8

    ReplyDelete

Post a Comment

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -