Sign In  Sign Up Live-Chat

Cell's getValue() returns null when cell contains specific formula in Excel 2007

Last post 10-13-2008, 12:57 PM by Amjad Sahi. 5 replies.
Sort Posts: Previous Next
  •  10-10-2008, 4:47 PM 147538

    Cell's getValue() returns null when cell contains specific formula in Excel 2007

    I'm running into an issue where com.aspose.cells.Cell's getValue() method returns null when reading a cell with a formula containing the TEXT function or '&' (concatenation char) or a simple reference (like '=A1'). This behavior is exhibited only in Excel 2007 and not in Excel 2003. I tried the SUM function and getValue() is able to return the correct value.

    Arbitrary examples of formulae I'm facing issues with are
    =A3
    =TEXT("A","")
    ="Value is "&" 25"

    Anyone else experience this issue?
    Filed under: getValue
     
  •  10-11-2008, 8:04 AM 147574 in reply to 147538

    Re: Cell's getValue() returns null when cell contains specific formula in Excel 2007

    Attachment: Present (inaccessible)

    Hi,

    I have tested your scenario but could not find the issue you have mentioned. I have a template .xlsx file which has your desired formulas into its first worksheet cells, I run the following code and it gives me perfect results.


      Workbook workbook = new Workbook();
      workbook.open("e:\\files\\formulaTest.xlsx",FileFormatType.EXCEL2007);
      Worksheet worksheet = workbook.getWorksheets().getSheet(0);
      Cells cells = worksheet.getCells();
      Cell cell = cells.getCell("A1"); //The A1 cell contains =A3 formula
      System.out.println(cell.getValue()); //the value is ok.....
      cell = cells.getCell("C1");//The C1 cell contains the formula =TEXT("A","")
      System.out.println(cell.getValue()); // the value is ok

       cell = cells.getCell("C2");//The C2 cell contains the formula ="Value is "&" 25"
      System.out.println(cell.getValue());// the value is ok

    Which version of Aspose.Cells for Java you are using. I have tried the latest version/fix (attached). Could you try the attached version.

    Thank you.

     


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  10-13-2008, 11:46 AM 147760 in reply to 147574

    Re: Cell's getValue() returns null when cell contains specific formula in Excel 2007

    I'm using 1.9.4. Let me give my scenarios a shot with 1.9.5.29 that you've attached, check my results and post back.
     
  •  10-13-2008, 11:55 AM 147762 in reply to 147760

    Re: Cell's getValue() returns null when cell contains specific formula in Excel 2007

    Hi,

    Well, Could you attach the screenshot(s) as I don't find them attached.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  10-13-2008, 12:45 PM 147765 in reply to 147762

    Re: Cell's getValue() returns null when cell contains specific formula in Excel 2007

    So 1.9.5 did the trick. All my scenarios passed. I obviously have to upgrade from 1.9.4 to 1.9.5.
    Appreciate your prompt responses.
    Thanks.
     
  •  10-13-2008, 12:57 PM 147766 in reply to 147765

    Re: Cell's getValue() returns null when cell contains specific formula in Excel 2007

    Hi,

    Good to know that you don't find any issue.

    Have a good day!

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
View as RSS news feed in XML