Setting cell formula is really slow

Posted by: paul on 27 December 2017, 8:15 am EST

    • Post Options:
    • Link

    Posted 27 December 2017, 8:15 am EST

    I am running into an issue when updating cell formulas in large quantities. I have implemented code to auto fill down a column when the bottom right corner of a cell/range is double clicked. My code takes over 2 minutes to fill in about 3000 cells. This should not take any time at all. The issue I am running into occurs when trying to update the cells with formulas. For example I type a vlookup formula into a single cell on the first row of my sheet that references a second sheet. Then I am double clicking on the bottom right corner of this cell to trigger filling all the cells below it with their corresponding formula. I am able to calculate the correct formula in relation to the original cell for each of these cells with no lag at all. I have isolated the time problem to my line of code that reads:

    cell.formula(newFormula);

    Each time that line is called it takes about 60ms and when called 3000 times this degrades performance. Paint is suspended when I call to update the cells formulas’. Are there any suggestions to speed this up or is there anything you guys can do to speed up setting a cell’s formula?

  • Posted 28 December 2017, 1:58 am EST

    Hello,

    It seems you have too many columns in the sheet to calculate VLookUp formula. Suspending the paint or calc service should work to improve performance.

    Could you please provide me your sample application to debug further?

    Thanks,

    Deepak Sharma

  • Posted 29 December 2017, 7:20 am EST

    I got it working better thanks! When I used sheet.resumeCalcService(true); like shown in the documentation my application still ran slow but when I used sheet.resumeCalcService(false); my application sped up significantly.

Need extra support?

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

Learn More

Forum Channels