在Powerpoint中粘贴位图图像,无法resize。 错误selection.shaperange:无效的请求。 没有合适的select

I'm running vba to copy and paste ranges from Excel to PPT and I just changed the paste type to Bitmap and now I keep getting this error: - selection.shaperange: invalid request . nothing appropriate is being selected on this line of code: - PPApp.ActiveWindow.Selection.ShapeRange.Left = 0 I have Excel 2010 and need to use late binding as you can see from the code below.I have searched far and wide but can't seem to find a solution. Any help would be greatly appreciated. 'variables for referencing PPT Dim PPApp As Object Dim PPPres As Object Dim PPSlide As Object ' And another variable to hold a shape Dim PPTShp as Shape Dim PresentationFileName As Variant Dim SlideCount As Long Dim lngSlideHeight As Long Dim lngSlideWidth As Long ' reference existing instance of PowerPoint Set PPApp = GetObject(, "Powerpoint.Application") ' reference active presentation ' 1 = PPViewSlide Set PPPres = PPApp.ActivePresentation PPApp.ActiveWindow.ViewType = 1 ' Determine height and width of slide lngSlideHeight = PPPres.PageSetup.SlideHeight lngSlideWidth = PPPres.PageSetup.SlideWidth 'select the object / table Range("H13:K24").Select 'copy the object / table Selection.CopyPicture appearance:=xlScreen, Format:=xlBitmap 'Selection.Copy 'add a new slide and paste in the table '12 = ppLayoutBlank If (SheetMap(h) = "Charts") Then SlideCount = PPPres.Slides.Count Set PPSlide = PPPres.Slides.Add(SlideCount + 1, 12) PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex End If 'paste and select the table '1 = PPpasteBitmap ' It's best NEVER to rely on selection if you can avoid it, so ' instead of this: PPSlide.Shapes.PasteSpecial DataType:=1 ' do this picks up the shape rather than the shaperange: Set PPTShape = PPSlide.Shapes.PasteSpecial(1)(1) 'Conditional formatting of slide (based on step) If (SheetMap(h) = "Charts") Then ' You don't need to go to the slide to work with its shapes. ' Use the shape reference created above instead: ' PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex PPTShp.Left = 0 PPTShp.Top = 50 PPTShp.LockAspectRatio = msoFalse PPTShp.ScaleHeight 0.9322, msoTrue, msoScaleFromTop PPTShp.ScaleWidth 0.6954, msoTrue, msoScaleFromLeft PPApp.ActiveWindow.Selection.ShapeRange.IncrementTop 16# End If 'add titles '1 = PPAlignLeft If (SheetMap(h) = "Charts") Then Set osh = PPSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=8, Top:=15, Width:=lngSlideWidth, Height:=10) osh.TextFrame.TextRange.Text = TitleMap(h, 1) osh.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 255) osh.TextFrame.TextRange.Font.Size = 12 osh.TextFrame.TextRange.Font.Bold = True osh.TextFrame.TextRange.Font.Italic = False osh.TextFrame.TextRange.ParagraphFormat.Alignment = 1 osh.TextFrame.TextRange.ParagraphFormat.Bullet = False End If End If