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
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
i just checked and if i select the graph in powerpoint and manually update then it updates.

i dunno.
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,261
Members
448,558
Latest member
aivin

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