public static void ReplaceExcelRange(Range com, InputSample input) { bool done = false; while (!done) { try { com.Value2 = input.GetInputArray(); done = true; } catch (Exception) { } } }