Embeddings in a SpreadsheetML Document

When an embedding is present in a SpreadsheetML document, it shall be stored as follows:

  • In the worksheet, the <oleObjects> element shall store one or more <oleObject> child elements, one for each embedding within the current worksheet. Each of those <oleObject> child elements shall also store: an explicit relationship to the associated Embedded Package or Embedded Object part, the ProgID for that embedded object, and (optionally) the last four digits of the shape ID for the associated VML shape. The shape ID itself shall be of the form _x0000_s####, where # specifies a single Arabic numeral, in order to be referenced as the alternate image for an embedding in a SpreadsheetML document.

  • In the worksheet, the sibling <legacyDrawing> element shall contain an explicit relationship to the VML Drawing part that (optionally) contains the image data which may be used in place of loading the actual object data.

For example, if we embed a Contoso Test object (an example for illustration) in a SpreadsheetML document, the following markup would be stored in the appropriate Sheet part:

<s:worksheet><s:legacyDrawing r:id="rId9" />
  <s:oleObjects>
    <s:oleObject progId="Contoso.Test.1" shapeId="1025" r:id="rId5"/>
  </s:oleObjects>
</s:worksheet>

If we examine this markup, it can be seen that:

  • The <oleObject> element specifies that we have one embedded object on the worksheet. Its attributes specify that the object is of type Contoso.Test.1 and that the explicit relationship to the embedded object is rId5.

  • The sibling <legacyDrawing> element specifies that the Legacy Drawing part which contains the associated legacy drawing data is contained at the target of the relationship with an ID of rId9.

  • If we examine the VML Drawing part's contents, we'll see the shape which ends in 1025, which contains the alternate image for the object:

<v:shape id="_x0000_s1025" type="#_x0000_t75" style='position:absolute;
  margin-left:240.75pt;margin-top:105.75pt;width:334.5pt;height:253.5pt;
  z-index:1' filled="t" fillcolor="window [65]" stroked="t"
  strokecolor="windowText [64]" o:insetmode="auto">
  <v:fill color2="window [65]"/>
  <v:imagedata o:relid="rId1" o:title=""/>
  <x:ClientData ObjectType="Pict">
    <x:SizeWithCells/>
    <x:Anchor>5, 1, 7, 1, 11, 63, 23, 19</x:Anchor>
    <x:CF>Pict</x:CF>
  </x:ClientData>
</v:shape>