The following example shows you how to cancel a long running calculation. The engine checks the cancellation token throughout evaluation and aborts the run with a CalcCancelledException when the token is set, which keeps a server responsive when a large workbook arrives.