title: Adding picture to powerpoint slides via C# throws The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
body: <p>Hie guys,</p>
  
  <p>I have a block of code here:</p>
  
  <pre><code>System.Net.WebClient wc = new System.Net.WebClient();
  byte[] data = wc.DownloadData(xmlTempNode.Attributes["imageurl"].Value.ToString());
  MemoryStream ms = new MemoryStream(data);
  System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
  string strImagePath = pptdirectoryPath + "\\" + currentSlide + "_" + shape.Id + ".png";
  img.Save(strImagePath);
  tempSlide.Shapes.AddPicture(strImagePath, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoTrue, shape.Left, shape.Top, Convert.ToInt32(xmlTempNode.Attributes["imgwidth"].Value), Convert.ToInt32(xmlTempNode.Attributes["imgheight"].Value));
  shape.Delete();
  </code></pre>
  
  <p><code>tempSlide.Shapes.AddPicture</code> works fine for smaller images,and it fails when resolution is higher(here fail means response is not received for infinite time and throws exception when page is refreshed).</p>
  
  <p><strong>Exception Message:</strong> The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
     at Microsoft.Office.Interop.PowerPoint.Shapes.AddPicture(String FileName, MsoTriState LinkToFile, MsoTriState SaveWithDocument, Single Left, Single Top, Single Width, Single Height).</p>
  
  <p>Any help would be appreciated.</p>