I have created a tool for loading Excel charts to PowerPoint. The idea is to avoid external links so that presentations don’t break when sent to other users.
Any user can take an excel updater file, create some charts, record the locations of the target images in the PP presentation, and update the presentation whenever the data changes.
The process involves listing the charts that are in excel by chartname (sheet1 ONLY),
taking an image copy of the chart,
checking that ID tags for the files match,
pasting image into the open power point target, listed by slide number and shape name,
and duplicating the size and position of the chart.
A similar process is carried out for text boxes.
This has worked well in windows, but the process breaks when I try to use in excel for Mac. Whenever it gets to the stage of pasting an image into Powerpoint I get Error 5, procedure call invalid. at this location
Copy to clipboard
PPO.Select
PPSlide.Shapes.PasteSpecial ppPasteEnhancedMetafile
I’ve tried varying the image file type, and tried some conditional compile code to use an apple script solution, but I can’t get it to work. My latest was
Copy to clipboard
#If Mac Then
ws.PasteSpecial Link:=False, DisplayAsIcon:=False, Format:=3
ws.Shapes(ws.Shapes.Count).Copy
PPO.Select
AppleScriptTask "CopyPasteScript.applescript", "PastePowerpoint", ""
#Else
' Paste the range
PPO.Select
PPSlide.Shapes.PasteSpecial ppPasteEnhancedMetafile
#End If
I don't really understand apple scripts. Is this even possible on a mac?
Any help on this problem would be GREATLY appreciated.
EDIT My example file does not seem to be loading. Here is the larger sub for chart transfer
Bookmarks