c# - Create excel async function -


i have excel function get's data internet. problem function takes long time execute , slows down everything.

it amazing if can change value of cell without changing formula! if call function =getnumofemployee() returns 0 imediately , addin when result can replace value of cell 100 example. if fomula gets lost , not want happen.

what did in order preserve formula change formatting of cell doing:

this.application.activecell.numberformat = 5; 

if active cell had 0, line of code replace value 5 cool. preserve formula , have new value.

the problem approach lot of calculations , every time write line:

this.application.activecell.numberformat = 1234; 

excel saves formating at:

enter image description here

and reach maximum number of formatings excel enables. in 1 minute list has 500 formats , not able delete them. if programatically delete them excel acts kind of slow , windows spining mouse icon every time delete format.

so in short replace value of cell without changing its' formula addin once have result need back. should place value right of cell?


Comments