так что я сейчас делаю это ...
//Codeblock edited to include otaku upgrade
const String GIFpastespecialformat = @"Picture (GIF)";
const Int32 Onemoreshape = 1;
Int32 shapeCount = sht.Shapes.Count;
WorksheetPasteSpecialArgs wspa = new worksheetpastespecialargs();
wspa.Format = GIFpastespecialformat;
wspa.Link = False;
wspa.DisplayAsIcon = False;
List<Int32> oldShapes = new List<Int32>();
foreach (var item in sht.Shapes.Items())
{
oldShapes.Add(Item.ID);
}
sht.PasteSpecial(wspa);
if((shapeCount + Onemoreshape) == sht.Shapes.Count)
{
foreach (var item in sht.Shapes.Items())
{
if(oldShapes.Exists(i => i == item.ID) == false)
{
//work with shape here
}
}
}
else
{
//report and deal with comexception, user intervention, etc
}
Где sht - переменная, представляющая рабочую таблицу, с которой я работаю.