title: Applescript/Excel Saving Charts as Images
body: <p>I am trying to save the first chart in a sheet called charts as a PNG to the desktop.  I get the following error on the "save as picture" line: </p>
  
  <p>error "Microsoft Excel got an error: Parameter error." number -50   </p>
  
  <pre><code>tell application "Microsoft Excel"
      set theChart to first chart object of sheet "Charts"
      set filePath to "Macintosh HD:Users:User:Desktop:Chart.png" as text
      save as picture theChart picture type save as PNG file file name filePath
  end tell
  </code></pre>
  
  <p>I have also tried telling the chart itself and receiving the same error:</p>
  
  <pre><code>tell theChart
      save as picture picture type save as PNG file file name filePath
  end tell
  </code></pre>
  
  <p>From the dictionary and other known examples the syntax appears to be correct but any help would be greatly appreciated.</p>