Hi,
I have solved it myself. I am posting it here just in case anyone else needs.
I modified the code for the "Drawing" class. The below code is mentioned:
if (imageNumber == 1)
{
Drawing drawing = new Drawing() { Id = "rId" + drawingPartId.ToString() };
//Check whether the WorksheetPart contains VmlDrawingParts (LegacyDrawing element)
if (sheet1.VmlDrawingParts == null)
{
//if there is no VMLDrawing part (LegacyDrawing element) exists, just append the drawing part to the sheet sheet1.Worksheet.Append(drawing);
}
else
{
//if VmlDrawingPart (LegacyDrawing element) exists, then find the index of legacy drawing in the sheet and inserts the new drawing element before VMLDrawing part
int legacyDrawingIndex = GetIndexofLegacyDrawing(sheet1);
if (legacyDrawingIndex != -1) sheet1.Worksheet.InsertAt<OpenXmlElement>(drawing, legacyDrawingIndex);
else
sheet1.Worksheet.Append(drawing);
}
}
The complete set of code is available at "http://social.msdn.microsoft.com/Forums/en/oxmlsdk/thread/5c6e7ebd-66e2-40fa-9194-aed5cdc3f0ae"
In the code available in above link we need to just modify the "Drawing" part