- #Powerpoint fix broken links how to#
- #Powerpoint fix broken links update#
- #Powerpoint fix broken links code#
- #Powerpoint fix broken links free#
#Powerpoint fix broken links free#
Get our FREE VBA eBook of the 30 most useful Excel VBA macros.Īutomate Excel so that you can save time and stop doing the jobs a trained monkey could do.īy entering your email address you agree to receive emails from Excel Off The Grid.
#Powerpoint fix broken links code#
'Release the memory Set pptApp = Nothing Set pptPresentation = Nothing Set pptSlide = Nothing Set pptShape = Nothingįor the code above it will be necessary to set the values for the sourceFileName, oldFilePath and newFilePath variables. PptApp.Visible = True 'Set the variable to the PowerPoint Presentation Set pptPresentation = (sourceFileName) 'Set the variable to the PowerPoint Application Set pptApp = New PowerPoint.Application NewFilePath = "String of\New File Path\Excel File2.xlsx" SourceFileName = "C:\File Path\Of Source File\File Name.pptx"
#Powerpoint fix broken links update#
'Tools -> References -> Microsoft PowerPoint x.xx Object Library Dim oldFilePath As String Dim newFilePath As String Dim sourceFileName As String Dim pptApp As PowerPoint.Applicationĭim pptPresentation As Object Dim pptSlide As Object Dim pptShape As Object 'The file name and path of the file to update Select Tools -> References, then select the Microsoft PowerPoint x.xx Object Library from the list. The code below uses Early Binding, so you will need to set the references to the PowerPoint object library. Press ALT + F11 to open the Excel Visual Basic Editor.
It is also possible to update the links in PowerPoint from within Excel. You just need to set the values for the newFilePath and oldFilePath variables listed in the code above.Įdit the linked documents from Excel using VBA = msoLinkedOLEObject Or pptShape.Type = msoLinkedChart Then 'Use Replace to change the oldFilePath to the newFilePath 'Find out if the shape is a linked object or a linked picture If pptShape.Type = msoLinkedPicture Or pptShape.Type _ 'Loop through each shape in each slide For Each pptShape In pptSlide.Shapes 'Loop through each slide in the presentation For Each pptSlide In pptPresentation.Slides 'Set the variable to the PowerPoint Presentation NewFilePath = "String of\New File Path\Excel File 2.xlsx" 'The new file path as a string (the text to replace with)
OldFilePath = "String of\File Path\To Be Replaced\Excel File.xlsx" 'The old file path as a string (the text to be replaced) Right-click on the VBAProject, select Insert -> Module.Ĭopy the code below into the code window.ĭim oldFilePath As String Dim newFilePath As String Dim pptPresentation As Presentation Open the Visual Basic Editor in PowerPoint (ALT+F11).
This can be a significant time saver as the PowerPoint presentation can be updated automatically.
#Powerpoint fix broken links how to#
In a previous post, we considered how to link Excel files to PowerPoint presentations.