- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
private Excel._Application _excel;
...
private void RefreshFormulas(FormulaRefreshOption formulaRefreshOption, object objectToRefresh)
{
//Где-то в дебрях километрового метода бросилось в глаза
...
try
{
Excel.Range intersection = selection, selection2 = selection;
while (selection2 != null)
{
intersection = _excel.Intersect(selection2, selection2.Dependents,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
System.Windows.Forms.Application.DoEvents();
excelUtilities.RecalculateRangeInstance(true, intersection/*_excel.Selection as Excel.Range*/);
selection2 = intersection;
}
}
catch (Exception) { /*ignore the exception because .Dependents will throw an exception if there aren't any dependents*/}
...
}
Lure Of Chaos 05.01.2012 12:06 # 0
danilissimus 05.01.2012 13:53 # 0
Lure Of Chaos 06.01.2012 23:19 # 0
guest8 09.04.2019 12:26 # −999