PowerPoint emits an error when trying to save a file that opened without problems.

Stefan Krabbe 0 Reputation points
2024-07-30T10:39:54.57+00:00

PowerPoint opens the presentation without problems, but emits an error when trying to save it, and then the file is saved without problems, ie the files works fine after saving.

The solution I seek is how to modify the xml files of the presentation (I assume chart1.xml), so that PowerPoint does not emit an error when trying to save the file.

I've browsed this forum and other sites for similar problems, but none of them have a solution that works.

We can NOT use office to fix the file as it would require us to open thousands of files manually. We want to be able to automate bugfix the files of this type, ie automatically unzip the files, then run a script to modify the xml of each file, and then zip them again.

Here is a link to a folder containing the PowerPoint file test.pptx:

https://drive.google.com/drive/folders/1d8-NNkmOJ_Nww4pTCZAoMkKhiyyy87cg?usp=drive_link

Here is a link to an image of the error dialog that PowerPoint shows when trying to save the file:

https://imgur.com/a/lz0LvRr

For convenience I repeat the error message PowerPoint displays:

        PowerPoint couldn't read some content in test.pptx and removed it.
        Please check your presentation to see if the rest of it looks ok.

The problem PowerPoint has, seem to be with the extension-lists that defines an identifier for each of the series. Here you can see the first two extension-lists of the chart of the presentation (chart1.xml):

<c:ser>
    ...
    <c:extLst>
        <c:ext xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart"
               uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}">
            <c16:uniqueID val="{00000000-2153-43F5-A17B-C2679033F518}" />
        </c:ext>
    </c:extLst>
</c:ser>
<c:ser>
    ...
    <c:extLst>
        <c:ext xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart"
               uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}">
            <c16:uniqueID val="{00000001-2153-43F5-A17B-C2679033F518}" />
        </c:ext>
    </c:extLst>
</c:ser>

If I remove the the extension-lists then PowerPoint opens the file (again without problems as it did before) and can now also save the file without problems, ie without displayin an error message.

If I don't remove the extension-lists then PowerPoint has the problem described above, and when I click Ok to let PowerPoint save the file, it basically replace the extension-lists with identical extensions-lists, except that the value of the uniqueID's have changed.

I do not understand what is wrong with the presentation and I am convinced that the automated AI response will be nonsense.

How should the xml in the presentation be modified so that PowerPoint does not emit an error?

The problem is the same on multiple PC's with different versions of windows (10 and 11), but all currently using:

Microsoft® PowerPoint® for Microsoft 365 MSO (Version 2405 Build 16.0.17628.20006) 64-bit

PowerPoint
PowerPoint
A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
305 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,996 questions
Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
139 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Stefan Krabbe 0 Reputation points
    2024-07-30T14:47:15.6633333+00:00

    I'll answer the question myself, as I found out what causes the bug, so others don't have to waste time on it.

    It turns out that the OpenXML SDK 3.0.1 library, that was used to generate the PowerPoint file, creates the wrong casing for c16:uniqueID. It should be c16:uniqueId. So it's a bug in the SDK. I didn't notice the difference when I examined the file after saving it with PowerPoint.

    There are two solutions to the problem, depending on where in the chain we are.

    If we are the receivers of the PowerPoint file, then replace all occurrences of c16:uniqueID with c16:uniqueId in the xml files.

    If we are the producers of the PowerPoint file (using the OpenXML SDK with C#), then change the code that appends the unique identifer to the extension from:

    
    using C16 = DocumentFormat.OpenXml.Office2016.Drawing.Charts;
    
    ...
    
    var uniqueId = new C16.UniqueID() { Val = $"{{{seriesGuid}}}" };
    
    ext.Append(uniqueId);
    
    

    to

    
    ext.InnerXml = $"<c16:uniqueId xmlns:c16=\"http://schemas.microsoft.com/office/drawing/2014/chart\" val=\"{{{seriesGuid}}}\" />";
    
    

    where seriesGuid is the identifier for the series, for example "00000000-2153-43F5-A17B-C2679033F518".


  2. Tom Jebo 1,996 Reputation points Microsoft Employee
    2024-07-31T18:33:35.33+00:00

    Hi Stefan Krabbe,

    After reviewing your code for adding the uniqueId element I see that there are two issues here.

    1. If you had used the following class to append to ext:
         ext?.Append(new UniqueIdChartUniqueID() { Val = "{00000001-2153-43F5-A17B-C2679033F518}" });
      
      Then you would have gotten the correct c16:uniqueId element tag. There are two classes, one with the capital "D" and one with lower case "d".
    2. We don't have the uniqueId hooked up to the LineSerExtensionList/LineSerExtension (for example) classes so when the SDK reads this construct it will see the c16:uniqueId element as a OpenXmlUnknownElement. We will fix this in an upcoming release.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.