diff --git a/EPPlus/ExcelWorkbook.cs b/EPPlus/ExcelWorkbook.cs index ae05fc7..06f313b 100644 --- a/EPPlus/ExcelWorkbook.cs +++ b/EPPlus/ExcelWorkbook.cs @@ -4,7 +4,7 @@ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets. * See http://www.codeplex.com/EPPlus for details. * - * Copyright (C) 2011 Jan Källman + * Copyright (C) 2011 Jan Källman * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,8 +26,8 @@ * * Author Change Date * ****************************************************************************** - * Jan Källman Initial Release 2011-01-01 - * Jan Källman License changed GPL-->LGPL 2011-12-27 + * Jan Källman Initial Release 2011-01-01 + * Jan Källman License changed GPL-->LGPL 2011-12-27 *******************************************************************************/ using System; using System.Xml; @@ -890,7 +890,7 @@ private void SetNameElement(ExcelNamedRange name, XmlElement elem) { if (name.IsName) { - if (string.IsNullOrEmpty(name.NameFormula)) + if (string.IsNullOrEmpty(name.NameFormula)&& name.NameValue != null) { if ((name.NameValue.GetType().IsPrimitive || name.NameValue is double || name.NameValue is decimal)) {