title: Closing ChartData Window of a Word Document
body: <p>I have code that opens a Word document and goes through the charts, updating the data.</p>
  
  <p>The problem is that I call this macro multiple times in a row. Even though I close the Word application, the chartdata window remains open.</p>
  
  <p>Excel is crashing without telling me why but E think the problem is with the chartdata windows not being closed. Because if I run the macro only one time, it works.</p>
  
  <p>But, how do I close the chartdata window if the chart doesn't support this property?</p>
  
  <pre><code>Dim wdApp As Word.Application
  Dim wdDoc As Word.Document
  Dim wdShape As InlineShape
  Dim wdChart As Word.Chart
  
  Set wdApp = CreateObject("Word.Application")
  wdApp.Visible = True
  
  'Opening the document
  Set wdDoc = wdApp.Documents.Open("path_here")
  
  'Opening the chartdata window
  Set wdShape = wdDoc.InlineShapes(1)
  Set wdChart = wdShape.Chart
  wdChart.ChartData.Activate
  
  'Changing the data
  Range("B2").Value = 120
  Range("B3").Value = 155
  
  'Closing the app
  wdApp.Quit SaveChanges:=wdSaveChanges
  
  Set wdShape = Nothing
  Set wdChart = Nothing
  Set wdApp = Nothing
  Set wdDoc = Nothing
  </code></pre>