Update Linked Excel Slide in Powerpoint Slide Show -
i have powerpoint presentation needs loop continuously in order display information. want linked excel worksheet object in 1 slide refresh data each time slide displayed, showing updated data in looping presentation.
how go doing this?
the code update 1 line:
activepresentation.slides(2).shapes(1).linkformat.update
you can refer both slides
, shapes
index number or name. above example updates link 1st shape
object on 2nd slide
object. need follow steps below in order make code fire @ proper time.
from microsoft office documentation:
how to: use events application object
to create event handler event of application object, need complete following 3 steps:
- declare object variable in class module respond events.
- write specific event procedures.
- initialize declared object module.
declare object variable
before can write procedures events of application object, must create new class module , declare object of type application events. example, assume new class module created , called eventclassmodule. new class module contains following code.
vba
public withevents app application
write event procedures
after new object declared events, appears in object list in class module, , can write event procedures new object. (when select new object in object list, valid events object listed in procedure list.) select event procedure list; empty procedure added class module.
vba
private sub app_slideshownextslide(byval wn slideshowwindow) activepresentation.slides(2).shapes(1).linkformat.update end sub
initializing declared object
before procedure run, must connect declared object in class module (app in example) application object. can following code module.
vba
dim x new eventclassmodule sub initializeapp() set x.app = application end sub
run initializeapp procedure. after procedure run, app object in class module points microsoft office powerpoint application object, , event procedures in class module run when events occur.
Comments
Post a Comment