update Excel 'chart Object' in powerpoint with vba

almagg

Well-known Member
Joined
Aug 21, 2002
Messages
705
the code run from Excel opens a powerpoint template (potx), saves it as a pptx file then
gets the new path (since i do not know where and who will be using it), updates then breaks the links.

everything updates except for the two graphs - Chart1 and Chart 2
then i realized they are not 'Shapes'
what do i need for them to update?

thanks
.
.
.
Code:
For Each oPPTSlide In oPPTApp.ActivePresentation.Slides
    oPPTSlide.Select
    For Each oPPTShape In oPPTSlide.Shapes
        oPPTShape.Select
        If oPPTShape.Type = msoLinkedOLEObject Then
            oPPTShape.LinkFormat.SourceFullName = Replace(oPPTShape.LinkFormat.SourceFullName, sOldPath, sNewPath)
            oPPTShape.LinkFormat.Update
            oPPTShape.LinkFormat.BreakLink
        Else
        End If
     Next oPPTShape
Next oPPTSlide
 

Some videos you may like

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

almagg

Well-known Member
Joined
Aug 21, 2002
Messages
705
i just checked and if i select the graph in powerpoint and manually update then it updates.

i dunno.
 

almagg

Well-known Member
Joined
Aug 21, 2002
Messages
705
just noticed something else.

the links to the Charts do not contain the path, just the file name.
i relinked them and even deleted and repasted but they keep losing the path.
all the other links have the path i.e.,

C:\Tyco EHS\Site Safety Metrics Rollup.xlsm!Slides!R55C2:R72C14

but the two chart links have:

Site Safety Metrics Rollup.xlsm!Slides![Site Safety Metrics Rollup.xlsm]Slides Chart 1

now i have an old version and the charts in that version have the path.
(and it updates using the VBA code)

C:\Tyco EHS\Site Safety Metrics Rollup FY12.xlsm!Slides![Site Safety Metrics Rollup FY12.xlsm]Slides Chart 1

i got rid of the FY12 so it can be used in the next fiscal year without any changes.

so i am wondering why currently, when i copy/pastelink, is the path to the file path being cut off/lost?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,514
Messages
5,596,611
Members
414,080
Latest member
penguin23

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
Top