public static void SetCalcEngineCacheExpressions(this IXLWorksheet worksheet, bool value) { var wsType = worksheet.GetType(); var calcEngine = wsType.GetProperty("CalcEngine", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(worksheet, new object[] { }); calcEngine.GetType().GetProperty("CacheExpressions").SetValue(calcEngine, value, new object[] { }); }
public static void ResumeEvents(this IXLWorksheet sheet) { var type = sheet.GetType(); var method = type.GetMethod("ResumeEvents", BindingFlags.Instance | BindingFlags.Public); method.Invoke(sheet, new object[0]); }