C# worksheet function poor performance

S

Simon Murphy

Hi
I've written a simple worksheet function in C#. there is no shim, just .net.
The function takes an excel range and loops through each cell and is very
slow, something like 200 times slower than the Excel equivalent or the vba
equivalent.

The code is on another machine but is basically

public double TheFunction( Range rngList){
for(long i = rngList.Rows.Count; i>0; i--)
// do some simple adding (using range.value2 etc and finish

I was wondering if accessing the range inside the loop was the problem, or
has anyone got any suggestions?

cheers
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top