Help editing the link for excel graphics in power point

hey_wood

New Member
Joined
May 8, 2006
Messages
1
Hi,

I need help editing the link graphics that are in power point but linked to excel. We moved servers and the path is no longer the same. So instead of manualy doing each one, is there code that I could use to replace the drive name? example old map "x:clients\.." new map "g:old_clients\..".

Thanks,

Hey_wood
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Quite easy to do.

Cycle through all the slides.
Cycle through all the shapes
If it's the type of shape that has a sourcefullname, then copy that sourcefullname into a string variable.

Manipulate the string variable to swap out the old path with the new path. Reset the sourcefullname.

The code below will get you started, but instead of testing if the shape is a msoLinkedOLEObject, you may just want to go ahead and set the string to the sourcefullname. For error trapping, put resume next. And then test of the string is empty or not to determine if you are going to do text manipulation.


Sub aaatest()

Dim sld_X As Slide
Dim shp_X As Shape
Dim str_X As String

For Each sld_X In ActivePresentation.Slides

For Each shp_X In sld_X.Shapes

If shp_X.Type = msoLinkedOLEObject Then

str_X = shp_X.LinkFormat.SourceFullName
'[Manipulate str_X to substitute out the drive/directory name for the new one]
shp_X.LinkFormat.SourceFullName = str_X
End If
Next

Next

End Sub


Give a shot at it, if you have troubles with the code, post what you wrote and we could give you a hand.

:)
 
Upvote 0
Quite easy to do.

Cycle through all the slides.
Cycle through all the shapes
If it's the type of shape that has a sourcefullname, then copy that sourcefullname into a string variable.

Manipulate the string variable to swap out the old path with the new path. Reset the sourcefullname.

The code below will get you started, but instead of testing if the shape is a msoLinkedOLEObject, you may just want to go ahead and set the string to the sourcefullname. For error trapping, put resume next. And then test of the string is empty or not to determine if you are going to do text manipulation.


Sub aaatest()

Dim sld_X As Slide
Dim shp_X As Shape
Dim str_X As String

For Each sld_X In ActivePresentation.Slides

For Each shp_X In sld_X.Shapes

If shp_X.Type = msoLinkedOLEObject Then

str_X = shp_X.LinkFormat.SourceFullName
'[Manipulate str_X to substitute out the drive/directory name for the new one]
shp_X.LinkFormat.SourceFullName = str_X
End If
Next

Next

End Sub


Give a shot at it, if you have troubles with the code, post what you wrote and we could give you a hand.

:)
Hi, I'm trying to use this solution to my problem but I'm having some trouble with the code.
I have many linked charts to a file and I have to change the path to save the ppt file in a public directory. I want to change this path
C:\Data\luciana.padua\HC\Diagnóstico\Genérico\HSC\Bases
for this one:
O:\GROUPS\Ventas One\Customer Marketing\CATEGORIAS\RESTO HOME CARE (DW-HSC-FC)\LIMPIADORES\DIAGNOSTICO\Genérico\HSC\Bases

in the code you post it, where do I have to put the new path? so I have to add special characters like " " or ()
thanks!!!
 
Upvote 0

Forum statistics

Threads
1,225,475
Messages
6,185,195
Members
453,282
Latest member
roger_nz66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top