How to view corrupted mpp file of microsoft project ?exported a large (4,000 tasks) mpp to xml and when I attempt to open it with Project I get the error “An unexpected error occurred… The file may be damaged.” I tried exporting it several times but get the same error each time. I don’t see anything obvious in the xml, but it is huge and something could be lurking someplace that’s not apparent. Does anybody have any ideas?

Dani AI

Generated

Short summary of what to try next (builds on 's suggestion to determine whether export or import is failing). Exporting a 4,000‑task MPP to XML that then refuses to open usually means one of two things: the XML is not well‑formed (encoding, stray control bytes, broken tags) or Project's XML importer is choking on a particular record or construct. The following steps are a practical, low‑risk way to narrow the fault and recover usable data.

Quick lightweight checks you can do immediately: open the XML in a web browser — browsers show XML parse errors with line/column numbers, which often points directly to the problem. If the browser shows nothing, parse it with a script to get a clearer error message (example using Python's built-in parser):

# quick well-formedness check (Python 3)
import xml.etree.ElementTree as ET
try:
    ET.parse('project.xml')
    print('XML well-formed')
except ET.ParseError as e:
    print('Parse error:', e)

If the XML is well‑formed but Project still refuses it, use a divide‑and‑conquer approach on the <Tasks> block: make a copy, remove the second half of <Task> elements (keep the opening/closing <Tasks> tags intact) and try importing. If that imports, the offending data is in the removed half; repeat halving until you isolate the single bad <Task>. Inspect that task for common culprits: unescaped ampersands or angle brackets, null/control bytes, embedded HTML or long Notes fields, unusual characters from copy/paste, or custom field values that exceed expected formats.

If you locate the bad record you can either clean that task and reassemble the XML, import the file in chunks to a fresh project, or export smaller ranges (by date or ID) and remerge. If no single record surfaces, try importing on another Project version or Project Online (different importers tolerate different inputs). Work only on copies, keep backups, and if necessary salvage core data by exporting to Excel/CSV or using the Project API/automation to extract tasks programmatically.

We have to discover what is failing: the export or the import part of the process.

There are several open source programs to check if a XML file is valid. If the XML file is found to be invalid, you know there is a bug in the export process.

If you are not afraid of command line interfaces (this has future, also in MS environments), xmllint can be a good tool to validate XML.
MPP Viewer Tool – from

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.