Question

Ok I am creating an Excel Addin almost like the one from TFS It retrieves information Then when changes needs to be saved.

I succeeded in all of that but I have a flickering Issue with excel. As it loads the information from the server and then writes to cells in excel its like the mouse is flickering and each row is filled cell by cell very very slowly

But with TFS when you retrieve all tasks it is like one shot and its there in excel, no flickering.

How can this be achieved ?

Here is how I add the data into Excel

//Get the table (Index never changes and the addin checks an "VeryHiden" Contentsheet for compatibility)
var tableRetainer = _workingsheet.ListObjects[2];
for(var rowRetainer = 1; rowRetainer++;
{
 //get the specific devision from the List<Dictionary<string,object>>
 rangeRetainer[rowRetainer, 1].Value2 = devision["FeeAgreementID"];
 rangeRetainer[rowRetainer, 2].Value2 = devision["Task"];
 rangeRetainer[rowRetainer, 3].Value2 = devision["Tariff"];
 rangeRetainer[rowRetainer, 4].Value2 = devision["Quantity"];
}
Was it helpful?

Solution

Do you write to each cell individually? If yes, try optimizing by pasting large ranges at once. Anyway, you should try to make as few calls through Interop boundary as possible.

Plus you might consider alternatives like writing via ACE OleDB if you don't care about formatting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top