public static void WriteStringExt(this XmlWriter This, string str, IExcelWriter writer) { try { if (str.Length <= 0x7fff) { This.WriteString(str); } else { This.WriteString(str.Substring(0, 0x7fff)); } } catch (Exception exception) { writer.OnExcelSaveError(new ExcelWarning(exception.Message, ExcelWarningCode.General, -1, -1, -1, exception)); } }