Charts6 min read

Chart Dual-Syncing with Embedded Excel Workbooks

Synchronizing DrawingML <c:chartSpace> and embedded .xlsx workbook data caches.

1Why Other Libraries Cause "Repair Presentation" Prompts

In Microsoft PowerPoint, native charts are dual-layered: 1. The chart visual representation is defined in XML: ppt/charts/chart1.xml (<c:chartSpace>). 2. The underlying data source is stored as an embedded binary Excel workbook: ppt/embeddings/Microsoft_Excel_Worksheet1.xlsx. When standard open-source libraries only update the XML <c:strCache> or <c:numCache>, Microsoft Office detects a desynchronization between the visual cache and the binary Excel spreadsheet when a user clicks "Edit Data in Excel". PowerPoint then throws the infamous error: "PowerPoint found a problem with content in presentation.pptx. PowerPoint can attempt to repair the presentation."

2The Dual-Sync Solution

node-pptx-templater synchronizes BOTH layers simultaneously: - It mutates the DrawingML <c:ser>, <c:cat>, and <c:val> series cache trees. - It parses and updates the embedded .xlsx sheet XML (sheet1.xml) and shared strings table within the internal ZIP package. When the recipient opens the deck in PowerPoint or clicks "Edit Data in Excel", the numbers, series, and formulas match 100% with zero repair prompts.

3Usage Example

Single API call to update series and sync workbooks:

javascript
await ppt.useSlide(2).updateChart('FinancialPerformanceChart', {
  categories: ['FY23', 'FY24', 'FY25', 'FY26'],
  series: [
    { name: 'Gross Revenue', values: [42.1, 56.4, 78.9, 104.2] },
    { name: 'Operating Income', values: [12.4, 18.2, 27.5, 39.8] }
  ]
});