title: Excel 2003 Windows Forms Clipboard DataObject
body: <p>I'm trying to get access to Excel 2003 Chart copied into the clipboard.</p>
  
  <p>The chart image pastes fine into mspaint or wordpad.</p>
  
  <p>The problem is that I don't see the chart's data on my System.Windows.Forms.Clipboard object.</p>
  
  <p>I've read the following post:</p>
  
  <p><a href="https://stackoverflow.com/questions/1405756/pasting-image-from-excel-2003-clipboard">Pasting Image from Excel 2003 Clipboard</a></p>
  
  <p>and in my particular scenario the only time the PNG, JFIF, or GIF formats appear as formats on the clipboard DataObject is when I go to the Excel clipboard manager (in the Excel application) and re-copy the chart again while it's open.</p>
  
  <p>That is, if I clear my clipboard, open Excel 2003, create a chart, right click it, hit Copy, then check Clipboard.GetDataObject().GetFormats(), all I see is:</p>
  
  <pre><code>Clipboard.GetDataObject().GetFormats()
  {string[6]}
      [0]: "EnhancedMetafile"  // is null
      [1]: "Embed Source"  // is a MemoryStream of about 10KB which seems to be an OLE representation for the whole workbook
      [2]: "Object Descriptor" // a very short (10 bytes) MemoryStream
      [3]: "Link Source" // a very short (10 bytes) MemoryStream
      [4]: "Link Source Descriptor"  // a very short (10 bytes) MemoryStream
      [5]: "Link"  // null 
  </code></pre>
  
  <p>If I open the Excel Clipboard Manager under the Edit > Office Clipboard then copy the same chart, even though Clipboard.ContainsImage() returns false, I see:</p>
  
  <pre><code>Clipboard.GetDataObject().GetFormats()
  {string[10]}
      [0]: "Office Drawing Shape Format"
      [1]: "MetaFilePict"
      [2]: "EnhancedMetafile"
      [3]: "PNG+Office Art"  // can read with Image.FromStream
      [4]: "JFIF+Office Art"  // can read with Image.FromStream
      [5]: "GIF+Office Art"  // can read with Image.FromStream
      [6]: "PNG" // can read with Image.FromStream
      [7]: "JFIF" // can read with Image.FromStream
      [8]: "GIF" // can read with Image.FromStream
      [9]: "ActiveClipBoard"
  </code></pre>
  
  <p>and can get at any one of the image formats there as a MemoryStream without any problems.</p>
  
  <p>I need this to work without having to open the Excel Clipboard Manager. It works fine on 2007 and 2010 (which also includes a regular Bitmap format for my convenience so that Clipboard.ContainsImage() returns true)...</p>
  
  <p>I've verified this behavior on multiple workstations.</p>
  
  <p>I'm thinking next steps may be to get at the native <code>System.Runtime.InteropServices.ComTypes.IDataObject</code> or worse yet get a handle on the COM object for the running instance of Excel......but I'd rather not have to.</p>
  
  <p>Thanks for any help...</p>