1 Reply Latest reply: May 3, 2012 7:44 AM by m w RSS

    Export part of sheet with macro

    Paul Damen

      Hi all,

       

      I have a sheet with has several tables. I wrote a macro to copy the whole sheet to powerpoint which works fine:

       

      Sub PL

      Set objPPT = CreateObject("PowerPoint.Application")
      objPPT.Visible = True
      Set objPresentation = objPPT.Presentations.Add
      Set PPSlide = objPresentation.Slides.Add(1,11)

      ActiveDocument.Activesheet.CopyBitmapToClipboard
      with PPSlide.Shapes.Paste
      .Left = -125
      .Top = 80
      .Width= 990
      end with

      end sub

       

      The problem is that the sheet is now copying including all the listboxes etc. Could some one please help me how to cut off part of the image (so part of the left side and part of the top side) so it copies all the tables as 1 image but without the listboxes and other things?

       

      Thanks!

       

      Regards,

       

      Paul

        • Export part of sheet with macro
          m w

          These lines should crop the image from the left and top. Adjust the numbers as needed.

              objPPT.ActiveWindow.Selection.ShapeRange.PictureFormat.CropLeft = 359.58

              objPPt.ActiveWindow.Selection.ShapeRange.PictureFormat.CropTop = 189.64