title: Is there a way to rotate OLEobjects?
body: <p>I have a macro that will append a page to the current document from a pre-formatted template.  This page inserts a picture based off user selection, which they have the standard excel supported images(i.e. .jpg, .png, .bmp) as well as PDF's(taken off an AutoCAD program that can only save as PDF/DWG/DXF file types.  The problem I'm having is that I cannot rotate landscape print formatted images the way that I can with the regular images.  I know that the problem is likely that not all OLEobjects can be rotated and the shaperange option probably does not allow for rotation.  That being said, is it possible to do this within VBA?</p>
  
  <p>I have tried to use the OLEobject shaperange option, as well as inserting the PDF as a picture(which is not supported by MS-Office as far as I know).  I have also tried to select the OLEobject as a shape to no avail.</p>
  
  <pre><code>Set rng = crrntWorkbook.Sheets(1).Range("B" &amp; tempRow)
  'Allows for the insertion of PDF files into the workbook
  Set oleobj = ActiveSheet.OLEObjects.Add(Filename:=txtFileName, link:=False, DisplayAsIcon:=False)
  With oleobj
      'Inserts the picture into the correct cell
      oleobj.Top = rng.Top
      oleobj.Left = rng.Left
      'If the image is wider than it's height, image will be scaled down by it's width, otherwise it's height
      If oleobj.Width &gt; oleobj.Height Then
          oleobj.IncrementRotation = 90
          oleobj.Width = 545
          oleobj.Left = (570 - oleobj.Width) / 2
          oleobj.Top = oleobj.Top + 2
          'Centers the image
      Else
          oleobj.Height = 625
          oleobj.Left = (550 - oleobj.Width) / 2
          oleobj.Top = oleobj.Top + 2
      End If
  End With
  </code></pre>
  
  <p>The expected result is that the image will be rotated upon insertion, but I will get either a "runtime error '438' Object doesn't support this property or method" or a "runtime error -2147024809 the shape is locked and cannot be rotated if I use the shaperange approach"</p>