vba - Copy, paste Excel to PPT. Nothing on clipboard -
i've made sub filters on different strings in olist
and goes ws
copy chart, go ppt , paste. worked until today , i'm not sure changed. uses lot of activate , select later on edit out later (learned new skills along way). kinda need work before.
sub maakppt() application.screenupdating = false dim ppapp powerpoint.application dim pppres powerpoint.presentation dim ppslide powerpoint.slide 'ppt openen set ppapp = new powerpoint.application ppapp.visible = true ppapp.activate 'filteren op bsl en "planning" (strokengrafiek) kopiƫren worksheets("reo's gestart").activate activesheet.listobjects("tabel1").range.autofilter field:=2, criteria1:= _ "commercial banking" activesheet.listobjects("tabel1").range.autofilter field:=10, criteria1:= _ "lopend" sheets("planning").select activechart.copypicture _ appearance:=xlscreen, size:=xlscreen, format:=xlpicture 'activechart.chartarea.copy appearance:=xlscreen, size:=xlscreen, format:=xlpicture 'planning.copypicture appearance:=xlscreen, size:=xlscreen, format:=xlpicture 'sheets("planning"). 'ppt template openen en plakken ppapp.presentations.open ("f:\wgd\dep 456566-centrale reorganisatieteam\aab crt algemeen\pmo crt\dashboards\totaal overzicht tbv mt\template totaaloverzicht.pptx") set ppslide = ppapp.activepresentation.slides(2) ppslide.select ppapp.activewindow.view.paste ppapp.activewindow.selection.shaperange.align msoaligncenters, true ppapp.activewindow.selection.shaperange.align msoalignmiddles, true ppslide.shapes(2).width = 600 ppslide.shapes(2).height = 375 ppslide.shapes.range(2).align msoaligncenters, true ppslide.shapes.range(2).align msoalignmiddles, true set ppslide = ppapp.activepresentation.slides(3)
the code gives error on ppapp.activewindow.view.paste
says there nothing on clipboard.
edit: i've made ppslide.view.paste.select
workaround. when activate slide , resume macro works. far optimal however.
any tips?
Comments
Post a Comment