Results 1 to 3 of 3
  1. #1
    ginger0001 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Question How to read from excel?

    1. I have edit my excel cell content by
    InputStream inp = new FileInputStream("exceltoopl.xls");
    org.apache.poi.ss.usermodel.Workbook wb;
    wb = org.apache.poi.ss.usermodel.WorkbookFactory.create (inp);
    org.apache.poi.ss.usermodel.Sheet sheet = wb.getSheetAt(0);
    org.apache.poi.ss.usermodel.Row row = sheet.getRow(4);
    org.apache.poi.ss.usermodel.Cell cell = row.getCell(1);
    cell.setCellValue(date);

    2.After I edited my excel cell, another cell in my sheet is changing

    3.But after I try to read the another cell that is changing by this
    workbook = jxl.Workbook.getWorkbook(new File("exceltoopl.xls"));
    jxl.Sheet sheet1 = workbook.getSheet(0);
    pass = sheet1.getCell(3,4).getContents();
    System.out.print(pass);

    4. I got the result that the same as before editing cell content

    How can I get the new result of another cell
    Thank you

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: How to read from excel?

    Moved from Advanced Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: How to read from excel?

    In (1) you are editing cell B5.
    In (2) you haven't told us what cell is changing.
    In (3) you are reading cell D5, using JExcel...
    So I'm not surprised D5 hasn't changed.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. How to read Excel file with java
    By chetan-24 in forum New To Java
    Replies: 6
    Last Post: 09-13-2014, 01:43 PM
  2. How to read Excel file in java
    By nagaraj in forum New To Java
    Replies: 7
    Last Post: 03-18-2011, 06:09 AM
  3. JXL read excel documents
    By ironicending in forum Java Applets
    Replies: 1
    Last Post: 09-08-2010, 01:42 AM
  4. How to read EXCEL Sheet using XML
    By raju.i in forum New To Java
    Replies: 1
    Last Post: 04-19-2010, 01:39 AM
  5. How to Read Excel file??
    By spalax in forum New To Java
    Replies: 3
    Last Post: 08-15-2009, 06:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •