Posted 21 July 2025, 1:02 am EST
Hi,
After thorough analysis, we have found that the original method for copying formulas - GrapeCityPackageAccessor::CopyFormula is splitting large ranges into many small ones, which caused repeated internal updates and significantly slowed down the operation in versions after 7.1.1.
To address this issue, we recommend that you update the CopyFormula implementation as follows:
public bool CopyFormula(string sourceRangeAddress, string destinationRangeAddress)
{
var sourceRange = getRange(sourceRangeAddress);
if (sourceRange == null) return false;
if (sourceRange.IsSingleCell() && !sourceRange.HasFormula)
// 単一セルかつセルに数式がない場合は何もしない
return false;
var hasFormulaSourceRange = sourceRange.SpecialCells(SpecialCellType.Formulas);
if (hasFormulaSourceRange == null)
// 数式がない場合は何もしない
return false;
var destinationRange = getRange(destinationRangeAddress);
if (destinationRange == null) return false;
sourceRange.Copy(destinationRange, new PasteOption {PasteType = PasteType.Formulas});
return true;
}
This approach ensures that the entire range is handled in a single operation, which should significantly improve the performance because the null checks are performed internally by the DsExcel API.
Furthermore, the ETA for the resolution of the core issue is DsExcel Version 9.0.0 now. In the meantime, we recommend applying the code update above to improve the performance.
You can further refer to the attached sample that uses the above code snippet and improves the performance in the latest versions (see below).
Please let us know if you require any additional assistance.
Attachment: GcExcelPerformance.zip
Kind Regards,
Chirag Gupta