PDA

View Full Version : Excel-tables stored as pics, how to edit all of them



jpar
02-28-2013, 04:01 AM
Hey everyone,
what a mistake I made at work, I created close to 300 presentations using tables that are linked to excel-files. Unfortunately these tables happened to include year 2011 instead of 2012... Now, as the tables I want to format are saved as pictures (following the removal of links that updated them in the first place), I cannot simply run 'find and replace' on the files to change the year. What I have to do is right-click on the picture -> Edit Pictures -> Agree that this is an imported picture and then I can get it to text format again to change the year. Each presentation includes 4 slides with wrong years in the tables.

Is the any solution other than clicking the tables one by one and replacing the texts? Thank you so much for all the help in advance!!

-J

John Wilson
02-28-2013, 12:23 PM
It will depend on exactly what you did. This may work but be sure to work on a copy!

Sub fixMe()
Dim osld As Slide
Dim oshp As Shape
Dim i As Integer
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = 13 Then
oshp.Ungroup.Select
Set oshp = ActiveWindow.Selection.ShapeRange(1)
For i = 1 To oshp.GroupItems.Count
If oshp.GroupItems(i).HasTextFrame Then
oshp.GroupItems(i).TextFrame.TextRange.Text = Replace(oshp.GroupItems(i).TextFrame.TextRange.Text, "2011", "2012")
End If
Next i
End If
Next: Next
End Sub