Wrong calculation of getUsedRange method

Posted by: pavloboiko on 7 July 2025, 6:01 am EST

  • Posted 7 July 2025, 6:01 am EST

    I use code

    const usedRangeType = GC.Spread.Sheets.UsedRangeType.data | GC.Spread.Sheets.UsedRangeType.table | GC.Spread.Sheets.UsedRangeType.style;
    const usedRange = excelWorksheet.getUsedRange(usedRangeType);


    and its return incorect range, you can see it on the video

    If skip GC.Spread.Sheets.UsedRangeType.style all worked correct, so the problem is in wrong styles calculationArchive.zip

  • Posted 7 July 2025, 7:52 am EST - Updated 7 July 2025, 7:57 am EST

    Hi,

    We reviewed the video you shared, but it does not appear to match the issue you described. Specifically, we couldn’t observe a discrepancy in the used range when including the UsedRangeType.style flag.

    Additionally, we tried to reproduce the issue on our end using the same configuration, but the returned used range appears consistent whether the style flag is included or not. Please refer to the attached sample code and the demonstration screenshot attached below.

    In case the issue is replicable in the latest version, 18.1.4, please share a minimal working sample with us for further investigation. You can also modify and share the attached sample.

    Attachment: https://jscodemine.mescius.io/share/R_RTl9cZz0eCwAARrnuMjQ/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fapp.js"%2C"%2Fstyles.css"]%2C"ActiveFile"%3A"%2Fapp.js"}

    Working:

    Kind regards,

    Chirag Gupta

Need extra support?

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

Learn More

Forum Channels