Greetings communities!
Here’s description of my process:
- Read Range workbook activity to read an Excel file (.xlsx) and store in a DataTable - InputFileDt.
- Read Range workbook activity to read exported SAP report (.xlsx) and store in a DataTable - ZM105Dt.
- For each row in InputFileDt, I check if the material code from input file match with any material code in ZM105Dt. If yes, input “True” in Remarks column in Input file. Otherwise, input “False”.
- After done iterate all rows, robot proceeds to update the input file using Write Range Workbook acitvity.
The first time I read range and update the file is working fine.
However, UiPath throws System.Xml.XmlException when I removed the updated data in “Remarks” column, save the file and rerun second time.
I checked there is no XML mapping/namespace declaration in the Excel file through ‘Developer’ tab → Source.
Has anyone encountered errors like this and what shall I do to resolve this other than recopy the original file to rerun?
22.10.10+Branch.support-v22.10.Sha.d796eef39ef460425a3cb2a072fd7b50e1c26930
Source: Read Range Workbook
Message: ‘x’ is an undeclared prefix. Line 2, position 2264.
Exception Type: System.Xml.XmlException
System.Xml.XmlException: ‘x’ is an undeclared prefix. Line 2, position 2264. at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at DocumentFormat.OpenXml.XmlConvertingReader.Read()
at DocumentFormat.OpenXml.OpenXmlCompositeElement.Populate(XmlReader xmlReader, OpenXmlLoadMode loadMode)
at DocumentFormat.OpenXml.OpenXmlElement.Load(XmlReader xmlReader, OpenXmlLoadMode loadMode)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.Populate(XmlReader xmlReader, OpenXmlLoadMode loadMode)
at DocumentFormat.OpenXml.OpenXmlElement.Load(XmlReader xmlReader, OpenXmlLoadMode loadMode)
at DocumentFormat.OpenXml.OpenXmlPartRootElement.LoadFromPart(OpenXmlPart openXmlPart, Stream partStream)
at DocumentFormat.OpenXml.Packaging.OpenXmlPart.LoadDomTreeT
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet) in C:\projects\closedxml\ClosedXML\Excel\XLWorkbook_Load.cs:line 0
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName) in C:\projects\closedxml\ClosedXML\Excel\XLWorkbook_Load.cs:line 43
at ClosedXML.Excel.XLWorkbook.Load(String file) in C:\projects\closedxml\ClosedXML\Excel\XLWorkbook_Load.cs:line 32
at ClosedXML.Excel.XLWorkbook…ctor(String file, XLEventTracking eventTracking) in C:\projects\closedxml\ClosedXML\Excel\XLWorkbook.cs:line 717
at ClosedXML.Excel.XLWorkbook…ctor(String file) in C:\projects\closedxml\ClosedXML\Excel\XLWorkbook.cs:line 707
at UiPath.Excel.WorkbookFile.InitializeExistingWorbookFile()
at UiPath.Excel.WorkbookFile…ctor(String workbookPath, String password, Boolean createNew)
at UiPath.Excel.Activities.WorkbookActivity1.ConstructWorkbook(String path, String password, Boolean createNew) at UiPath.Excel.Activities.WorkbookActivity
1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)