0
我有這個代碼複製一個叫做pastedpic 19的形狀,這是我的Excel文件中的形狀17,然後打開一個新的PowerPoint幻燈片並粘貼它。問題是我希望它被複製爲正常範圍和粘貼作爲這個副本,所以我可以在那裏更改數據。在Excel中複製一個範圍在Excel中粘貼
Sub exceltoPPT()
Dim PowerPointapp as Object
Dim myPresentation As Object
Dim mySlide As Object
Dim myShape As Object
Dim DestinationSheet7 As Worksheet
Dim DestinationSheet1 As Worksheet
Dim pastedPic3 As Shape
Set DestinationSheet1 = Workbooks("1_1_1_tt.xlsm").Sheets("Eingabefeld")
Set pastedPic9 = DestinationSheet1.Shapes(17)
' Create a New Presentation
Set myPresentation = PowerPointApp.Presentations.Add
'Add a slide to the Presentation
Set mySlide = myPresentation.Slides.Add(1, 11) '11 = ppLayoutTitleOnly
'pastedPic9.Copy
Windows(anan).Activate
Sheets("Eingabefeld").Range("B1:ES44").CopyPicture Appearance:=xlPrinter,Format:=xlPicture
'Paste to PowerPoint and position
mySlide.Shapes.PasteSpecial DataType:=2 '2 = ppPasteEnhancedMetafile
Set myShape = mySlide.Shapes(mySlide.Shapes.Count)
'Set position:
myShape.Left = -15
myShape.Top = 11
End Sub
有沒有人知道如何做到這一點?