KB0209: I cannot repair my PowerPoint file with PowerPoint 2013 or later

Problem

PowerPoint fails to repair a corrupt PowerPoint file.

Explanation

Repairing PowerPoint files fails if slides are accessed programmatically before PowerPoint repairs them. However, thinkcell and most likely also other add-ins must access slides when the file is opened, and there is no way for an add-in to know that a file is corrupt.

We filed a case with Microsoft, but so far Microsoft has not decided to fix it. If your company has a Microsoft Office Support contract and you want to ask Microsoft for a fix, you can refer to Microsoft case number 115040112590053. The error can be reproduced without thinkcell. Read more

Reproduction without thinkcell

The error can be reproduced without thinkcell if any code accesses the corrupt slides before the repair is finished. In the following reproduction, the PresentationOpen event handler calls code accessing all slides when the file opens, i.e., before the repair.

  1. Open PowerPoint 2013 or later with a new empty file.
  2. In PowerPoint, go to Insert > thinkcell > Tools Tools Menu icon > Deactivate thinkcell.
  3. Press Alt + F11 to open Microsoft Visual Basic for Applications.
  4. Add this code as a Class Module and name it cEventClass:

    Public WithEvents PPTEvent As Application
    
    Private Sub Class_Initialize()
        MsgBox "EventHandler is now active."
    End Sub
    
    Private Sub PPTEvent_PresentationOpen(ByVal pres As Presentation)
        On Error GoTo errHandle:
        
        Debug.Print "open file: " & pres.Name
        Dim i As Integer
        
        For i = 1 To pres.Slides.Count
            Debug.Print "Slide " & pres.Slides.Item(i).SlideNumber; " / " _ 
    	& pres.Slides.Count
        Next i
        
        Exit Sub
        
    errHandle:
        Debug.Print ("VBA Error: " & Err.Number & " " & Err.Description) & vbCr
    End Sub

  5. Add this code as a Module:

    Dim cPPTObject As New cEventClass
    
    Sub Initialize_Eventhandler()
        Set cPPTObject.PPTEvent = Application
        Debug.Print "**** EventHandler active ****"
    End Sub

  6. In the PowerPoint presentation window, press Alt + F8 to open the Macro window
  7. Run the Initialize_Eventhandler macro.
  8. Now open your corrupt PowerPoint file and try to repair it.

Solution

Until Microsoft fixes this bug, you can temporarily deactivate thinkcell as a workaround:

  1. Deactivate thinkcell in PowerPoint: Insert > thinkcell > Tools Tools Menu icon > Deactivate thinkcell
  2. Open your corrupt file and repair it
  3. Reactivate thinkcell in PowerPoint: Insert > thinkcell > Activate