Hey Guys
I have had great success with a macro sourced form Spreadsheet guru, however having difficulties modifying to meet my requirements.
I have multiple graphs on the same sheet, this script currently only converts the first graph on the slide, not the bottom one (any others) there are usually only 2 charts to a slide, but I would like it to loop through all of them and ... if i could use all my genie wishes, also convert linked tables to images also, in the same way.
This would mean opening the ppt, refreshing data and then running the macro, it would save me hours of time snipping.
Thank you in advance!
I have had great success with a macro sourced form Spreadsheet guru, however having difficulties modifying to meet my requirements.
I have multiple graphs on the same sheet, this script currently only converts the first graph on the slide, not the bottom one (any others) there are usually only 2 charts to a slide, but I would like it to loop through all of them and ... if i could use all my genie wishes, also convert linked tables to images also, in the same way.
This would mean opening the ppt, refreshing data and then running the macro, it would save me hours of time snipping.
VBA Code:
Sub LinkedGraphsToPictures()
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault
Dim shp As Shape
Dim sld As Slide
Dim pic As Shape
Dim shp_left As Double
Dim shp_top As Double
'Loop Through Each Slide in ActivePresentation
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.Type = msoChart Then
'Retrieve current positioning
shp_left = shp.Left
shp_top = shp.Top
'Copy/Paste as Picture
shp.Copy
sld.Shapes.PasteSpecial DataType:=ppPastePNG
Set pic = sld.Shapes(sld.Shapes.Count)
'Delete Linked Shape
shp.Delete
'Reposition newly pasted picture
pic.Left = shp_left
pic.Top = shp_top
End If
Next shp
Next sld
End Sub
Thank you in advance!