Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Created Unassigned: Adding comments gives XmlException. [14856]

$
0
0
Opening XLSX with Excel and saving it resolves the file issue but when I run my program it somehow brokes the excel file again on the second time. It's weird. So this error comes in third time when I run the program.

CODE:

public static void SetComment(ExcelRange cell, string text)
{
if (text != "")
{

if (cell.Comment == null) cell.AddComment(text, "CRM"); else cell.Comment.Text = text.Replace("<","").Replace(">","");
cell.Comment.AutoFit = true;
}
}


TRACE:

Unhandled Exception: System.Xml.XmlException: Unexpected end tag. Line 8721, pos
ition 7.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean prese
rveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at OfficeOpenXml.XmlHelper.LoadXmlSafe(XmlDocument xmlDoc, Stream stream)
at OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingBaseCollection..ctor(ExcelPackage
pck, ExcelWorksheet ws, Uri uri)
at OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingCommentCollection..ctor(ExcelPack
age pck, ExcelWorksheet ws, Uri uri)
at OfficeOpenXml.ExcelWorksheet.CreateVmlCollection()
at OfficeOpenXml.ExcelWorksheet.get_Comments()
at OfficeOpenXml.ExcelRangeBase.get_Comment()
at CashflowUpdater.Program.SetComment(ExcelRange cell, String text)
at CashflowUpdater.Program.SaveData(ExcelWorkbook& wb)
at CashflowUpdater.Program.UpdateCashFlowXLS(DateTime StartDate, String FileP
ath)
at CashflowUpdater.Program.Main(String[] args)

Viewing all articles
Browse latest Browse all 2262

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>