excel vba - Vba Powerpoint name a table -
i pasted table excel powerpoint code:
pptapp.commandbars.executemso ("pasteastablesourceformatting")
there other shapes on slide. how can make powerpoint find pasted table on slide , name it?
whenever paste in powerpoint appears on topmost layer can reference , optionally set name function:
option explicit ' *********************************************************** ' purpose: topmost shape current slide. ' inputs: sname - optionally rename shape ' outputs: returns shape object if slide not empty. ' author: jamie garroch ' company: youpresent ltd. http://youpresent.co.uk/ ' *********************************************************** function getpastedshape(optional sname string) shape dim lcurslide long ' current slide index lcurslide = activewindow.view.slide.slideindex activepresentation.slides(lcurslide) if .shapes.count = 0 exit function ' set reference shape on top layer set getpastedshape = .shapes(.shapes.count) if sname <> "" .shapes(.shapes.count).name = sname ' pasted objects should selected next line optional getpastedshape.select end end function
Comments
Post a Comment