0
previously으로 설명한 것과 비슷한 문제가 발생했지만 제 경우에는 모든 차트를 한 번에 내 ppt 템플릿 슬라이드의 특정 자리 표시 자로 chartobjects로 내보내려고합니다. 전체 내보내기의 경우 웹에서 다음과 같은 솔루션을 사용합니다. 해당 차트를 직접 붙여 넣는 방법은 무엇입니까? 어떻게 든 위에서 언급 한 해결책은 나를 위해 잘 작동하지 않습니다. 나는 어떤 조언을 감사하게 될 거라고Excel VBA - 대량 차트 내보내기 ppt
명시 적 옵션
하위 TotalExport_chart_to_ppt()
' Set a VBE reference to Microsoft PowerPoint Object Library
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim SlideCount As Long
Dim ws As Worksheet
Dim oChrtObj As ChartObject
Dim nPlcHolder As Long
' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
' loop through each worksheet within the active workbook
For Each ws In Worksheets
' loop through each chart object on current worksheet
For Each oChrtObj In ws.ChartObjects
' copy chart as chartobject
oChrtObj.Copy
' Add a new slide and paste in the chart
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutChart)
With PPSlide.Shapes.Paste
.Align msoAlignCenters, True
.Align msoAlignMiddles, True
End With
Next oChrtObj
Next ws
' Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
Set ws = Nothing
Set oChrtObj = Nothing
최종 하위