I have a large array full of ole color values that I need to apply to cells in an excel worksheet.
They could be applied with a simple for loop. pseudo code:
for (int k = 0; k < oleColorArray.Count; k++){
worksheet.Cells[1, k].Interior.Color = oleColorArray[k];
}
However this approach is slow, even after disabling ScreenUpdating. I've got around 1500 entries and it can take up to a minute.
Since the values in the array are all different I can't color the whole range.
I've seen that cell values can be applied directly from a 2D array using
range.set_Value(); or range.Value()
Microsoft.Office.Interop.Excel really slow
Is there any similar way to apply an array of ole colors, if not is there a faster approach I am missing?