View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Simon Murphy[_4_] Simon Murphy[_4_] is offline
external usenet poster
 
Posts: 37
Default C# worksheet function poor performance

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; i0; 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