PowerPoint VBA - Update linked graph from Excel at regular intervals -
i'm trying build system have powerpoint presentation linked graph external excel file. i've seen can right click graph in powerpoint , click "update link" , graph automatically updated.
but if want automated? if can done without creating add-in have been great. event handlers there in powerpoint? reckon there's event slidechanged or something? possibly have presentation go in endless loop , update link @ each new slide switch? there possibly huge amounts of graphs. , 1 slide each section of graphs.
or, other bright ideas? system i'm trying build framework collecting data , displaying in whatever form might wanted. data automatically imported economy software , database. i've created command line application opens excel file , runs macro (collecting fresh data , copy worksheet). command line application set run specific times via scheduled tasks. , it's data want show graphs from, automatically.
i did large bit of myself :)
here's code vb.net application (can used command line application)
imports microsoft.office.interop public class form1 dim opptapp sub updatepptgraph() each oslide in opptapp.activepresentation.slides each oshape in oslide.shapes if oshape.type = 10 oshape.linkformat.update() end if next next end sub private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load opptapp = new powerpoint.application opptapp.visible = true dim opresentation powerpoint.presentation opresentation = opptapp.presentations.open("c:\users\kenny\documents\charttest.pptx") updatepptgraph() end sub end class
this start. need figure out if can done while slideshow showing well. think should possible. update when manage worth mentioning :)
changing underlying slides (ie external excel app) should update running show; current slide in running show won't show update unless force redraw, when comes around in show again, update should visible.
all told, it'd easier automate ppt excel let control things , suck updates in on demand ... @ least unless want include add-in handle events in ppt.
Comments
Post a Comment