2017-10-25 4 views
2

을 .ppt로하는 범위를 복사하지 마십시오 선택한 영역을 PPT 파일에 붙여 넣지 않습니다. 당신이 나를 도울 수?VBA 내가 VBA 예를 슬라이드 NUM.3 현재 사용중인 코드가 수행하지만</p> <p>를 들어, 특정 슬라이드에서 시작 예를 PPT로 모든 워크 시트를 붙여 넣을

For Each ws In ActiveWorkbook.Worksheets 
     ws.Activate 
     Set rng = ThisWorkbook.ActiveSheet.Range("A1:Z100") 
'  Set mySlide = myPresentation.Slides.Add(myPresentation.Slides.Count + 1, 12) 
'  SlideNumb = myPresentation.Slides.Count 
     Set mySlide = myPresentation.Slides(SlideNumb).Select '(myPresentation.Slides.Count + 1, 12) '(myPresentation.Slides.Count + 1, 12) 
     rng.Copy 
     mySlide.Shapes.PasteSpecial DataType:=2 '2 = ppPasteEnhancedMetafile 
     Set myShape = mySlide.Shapes(mySlide.Shapes.Count) 
      myShape.LockAspectRatio = msoFalse 
      myShape.Left = 36.72 
      myShape.Top = 112.32 
      myShape.Width = 854.64 
      myShape.Height = 397.44 
     Application.CutCopyMode = False 
     ShtNum = ShtNum + 1 
     SlideNumb = SlideNumb + 1 
    Next ws 

답변

1

변경이 :

Set mySlide = myPresentation.Slides(SlideNumb).Select 

이 사람 : 여기

내 코드입니다

Set mySlide = myPresentation.Slides(SlideNumb) 

이 삭제 :

Set myShape = mySlide.Shapes(mySlide.Shapes.Count) 
     myShape.LockAspectRatio = msoFalse 
     myShape.Left = 36.72 
     myShape.Top = 112.32 
     myShape.Width = 854.64 
     myShape.Height = 397.44 

댓글을 삭제하고 다시 시도해주세요.

+1

덕분에, 첫 번째 줄 : 설정 mySlide에 = myPresentation.Slides (SlideNumb) 하지만 정말 필요한 모양 조정을위한 두 번째 부분을 노력하고 지금 옳은 일이었다. –