Value of not supported functions changed after saving

Posted by: yyoshimura on 27 July 2021, 5:42 pm EST

  • Posted 27 July 2021, 5:42 pm EST

    Hi,

    We have got a workbook with some formulas that are not supported by the library defined. If we disable the calculation engine and open the workbook, we can get the previous value of the function. If we save the opened workbook and then get the value again, the value becomes empty. Please refer attachment for reproduction. Is this behavior by design? We are expecting the value should not be changed after saving because calculation engine was stopped.

    Regards

    gcexcelperformance.zip
  • Replied 28 July 2021, 9:02 pm EST

    Hello,

    We too can observe the same behavior at our end and discussing the same with the developers. We will let you know as soon as we get the update on this from the developers' end.
    [Internal Tracking ID: DOCXLS-4612]

    Regards,
    Prabhat Sharma.
  • Marked as Answer

    Replied 29 July 2021, 4:25 pm EST

    Hello,

    This is not a bug, the reason is that you didn't apply license, the exported excel file was appended a watermark sheet and it becomes the active sheet, so the active sheet of last time is not the active sheet of the first time.

    You can write the code as following, then you will see the correct result:

    var workbook = new Workbook

    { EnableCalculation = false }
    ;

    var options = new XlsxOpenOptions

    { DoNotRecalculateAfterOpened = true }
    ;
    workbook.Open(@"../../Function.xlsx", options);
    Console.WriteLine($"Value before saving:

    {workbook.Worksheets[0].Range["A1"].Value}");

    workbook.Save(@"../../../Function_saved.xlsx");

    workbook.Open(@"../../../Function_saved.xlsx", options);
    Console.WriteLine($"Value after saving: {workbook.Worksheets[0].Range["A1"].Value}
    ");


    Regards,
    Prabhat Sharma.
  • Replied 29 July 2021, 5:19 pm EST

    Hi,

    Thank you for your support.
    We tried the code you provided and the result is working as expected.

    Regards
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels