Breaking Powerpoint slidemaster link from Excel vba + quick macro question

xcelintern

New Member
Joined
Nov 16, 2016
Messages
3
Excel: 2010
PP: 2010
PP Reference in Excel: enabled

Hi guys,

I started an internship 2 weeks ago and after a week of basic excel I've been thrust into VBA last week(I have no clue about it).
Everything I've learned and done so far has been thanks to forums and other websites like this but for this particular problem I was unable to find a solution that I could fit to my project.

I am using the following code in Excel VBA to start a Powerpoint presentation from Excel and after updating all the links (40+) and breaking them after it is supposd to save the PP under whatever name it extracted from excel.

Problem is: it only breaks the links on all the slides but not the one link on the slidemaster (master slide?). It does update it though. Any other suggestions for my frankensteined code would also be greatly appreciated.

Code:
Sub OpenandsavecurrentPP()
Dim pApp As Object 'Powerpoint.Application'
Dim pPreso As Object
Dim sPreso As String
Dim objSlide As PowerPoint.Slide
Dim objShape As PowerPoint.Shape

' where the original pp is loaded '
sPreso = "M:\Business Development 2016.pptm"

On Error Resume Next
Set pApp = GetObject(, "PowerPoint.Application")

If Err.Number <> 0 Then
Set pApp = CreateObject("PowerPoint.Application")
pApp.Visible = True
End If

On Error Resume Next
Set pPreso = pApp.Presentations(sPreso)

If Err.Number <> 0 Then
Set pPreso = pApp.Presentations.Open(Filename:=sPreso)
End If

'where links are being updated'
On Error GoTo 0
pPreso.UpdateLinks


 'If pPreso Is Nothing Then Exit Sub
 'this is where the links are broken'
     For Each objSlide In pPreso.slides
         Application.StatusBar = "Breaking Object Links in " & pPreso.Name & ", slide: " & objSlide.Name
         For Each objShape In objSlide.shapes
             With objShape
                 If .Type = msoLinkedOLEObject Then
                     .LinkFormat.BreakLink
                 End If
            End With
         Next objShape
         Set objShape = Nothing
     Next objSlide
     Set objSlide = Nothing
     Application.StatusBar = True

pApp.Run "Business Development 2016.pptm!Modul1.example macro"

        Dim FName           As String
        Dim FPath           As String
     
'where pp is saved'
        FPath = "M:\"

        FName = Sheets("ge aktuell").Range("A1").Text
    

        pApp.ActivePresentation.SaveAs FPath & FName & " BusinessDevelopment", 1
    
    


End Sub

The question I have about macros concerns the following line of code:

pApp.Run "Business Development 2016.pptm!Modul1.example macro"

This macro opens a window asking for an identification number (which i would like to extract and inject from my excel sheet as string) and then changing a picture on the title slide.

How could I adjust the code running the macro to also include the id number as string (which is present on excel sheet) that i now have to enter manually?

thanks in advance for your help, its greatly appreciated
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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