OOXML Hacking: Fix Broken PowerPoint Links

Please note: Microsoft has modified the nature of OLE links. It’s no longer possible to maintain relative OLE links (linked Excel and Word) in current versions of Office. The directions below will allow you to re-establish a broken link, but when you update the linked file, PowerPoint will write an abolute path. If you’re relinking other object types, like images, audio or video, this article will allow you to create permanent relative, semi-relative and absolute paths.

Someone sends you a presentation linked to an Excel file. The links don’t work and you can’t fix them without redoing them. Here’s how to fix broken PowerPoint links with a one minute of XML Hacking.

This article is really just for PowerPoint for Mac users. If you have the Windows version, you can fix broken links by choosing File>Info, then clicking on Edit Links to Files in the right-hand column under Related Documents. (Please note, the Edit Links option only appears if you actually have a link in the open presentation.) Word and Excel for Mac already have utilities to fix links.

If you haven’t hacked XML before, please read XML Hacking: An Introduction and XML Hacking: Editing in macOS. This article mentions Excel, which I’ve used as an example, but the same advice is true for Word files linked to PowerPoint. OLE Links to other formats, like PDF, are simply not supported on macOS.

In Office, links to documents include the complete path. Of course, when you move those linked files to a new computer, the path is always different, so the links must be corrected. The symptoms of a broken link depends on the type of link that was created. If the file creator selected a workbook section or chart, then used Paste Special to paste in a link, you’ll see this message when you double-click on the Excel excerpt:

Fix Broken PowerPoint Links - Paste Special

But the creator may have used Insert>Object instead, and chosen to link rather than embed the file. Then you’ll see this when you try to edit:

Fix Broken PowerPoint Links - Inserted Object

Then after dismissing that dialog, you’ll see the first one about the server error.


Fix Broken PowerPoint Links – The Steps

The issue is that a path is embedded in the PowerPoint file, and that path must be edited. Open the file in BBEdit.

The XML we need to change is associated with the slide(s) on which the Excel item is placed. So lets look. In the left-hand window, click on ppt. Then select slides then the _rels folder. Rels is short for relationships, and it’s the mechanism in every OOXML folder that tells PowerPoint where to find the objects in use.

The _rels folder has a .rels file for each slide in the presentation. Open the file for the slide containing the linked Excel. If the link was inserted using Paste Special, it will look like this (Pay attention to the third line and scroll all the way to the right. The path to be edited is in bold):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="file:///\\192.168.1.250\Dockets\Test\Excel\Link2PowerPoint.xlsx!Sheet1!R1C1:R1C4" TargetMode="External"/>
  <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout7.xml"/>
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing1.vml"/>
  <Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image1.emf"/>
</Relationships>

If the Excel file has been inserted as an linked object, it won’t include a range of cells, just the workbook name:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="file:///\\192.168.1.250\Dockets\Test\Excel\Link2PowerPoint.xlsx" TargetMode="External"/>
  <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout7.xml"/>
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing2.vml"/>
  <Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image2.emf"/>
</Relationships>

Since the Excel item was inserted on a Windows computer, the path uses backslashes instead of forward slashes. There are two path syntaxes that are acceptable. If both the file linked to and the presentation containing the link are in your User folder, you can use a relative path and the linked file will open up immediately. If the file linked to is on a network share or somewhere on your disk outside your user folder, you will have to use an absolute path and you will get a challenge from Office when you open the link.

Let’s do the relative path first. In this example, the Excel file is in my user Documents folder and the PowerPoint is in my user Downloads folder. So I edit:

Target="file:///\\192.168.1.250\Dockets\Test\Excel\Link2PowerPoint.xlsx"

to:

Target="file:///../Documents/Test/Excel/Link2PowerPoint.xlsx"

In Unix/DOS speak, the 2 dots mean “go up one level”, out of the Downloads folder where the presentation is into the main user folder. Then the slashes lead you down into the Documents folder and subfolders to the Excel location. Once you set a relative path, you must leave the PowerPoint file in the same folder. Moving it will break the path.


Fix Broken PowerPoint Links – The Best Relative Path

For a linked file that you know will be moved from desktop to desktop, the best strategy is to place both files in the same folder. Then use this path:

Target="file:///Link2PowerPoint.xlsx"

Now even if you move it back to Windows, the linked Excel file will open as expected. As I noted above, when you open or update the linked Excel (or Word) file, PowerPoint will replace your relative path with an absolute one. This only happens with OLE links. For picture, audio, video and other file types, the relative link will remain unless you manually update.


Fix Broken PowerPoint Links – Absolute Paths

If the file to be linked to is on another disk, use an absolute path. With an absolute path, you can move the PowerPoint file anywhere on your computer or to other machines and it will still be able to find the linked file. Here’s what an absolute path looks like:

Target="file:///Volumes/TheNameOfYourHardDisk/Users/YourUserName/Documents/Test/Excel/Link2PowerPoint.xlsx"

Important! A macOS absolute path must begin with Volumes, followed by a slash and the name of the disk. If your network is set up for different operating systems, you’ll probably use an IP address instead, as shown in the original file path. Consult with your IT department.

Office 2016 for Mac applications are sandboxed applications, so when you first open an Office file linked with an absolute path, you’ll see a warning:


Fix Broken PowerPoint Links - Absolute Path Warning 1

Click on Select…, then you’ll see:

Fix Broken PowerPoint Links - Absolute Path Warning 1

Select the correct file if it isn’t already selected, then click on Grant Access. Now double-click on the linked Excel item to edit and you’ll see this again:

Fix Broken PowerPoint Links - Edit Warning

OK, that’s something of a hassle, but the good thing is that you won’t see those warnings again as long as the linked file says in the same place with the same name. You also only get warned once per placed file, even if there are multiple uses of that file in your presentation.

Linked files are a huge benefit when you have a data source that is constantly being updated. Using them means your presentation can always be up to date. Now that you know how to fix the links, you have a very useful new tool.

9:36 pm

27 thoughts on “OOXML Hacking: Fix Broken PowerPoint Links

  1. This was very helpful, thank you for the post. I am using it to edit links to an image file in Powerpoint. I am using Windows 7 and Microsoft Office 2010
    I have edited my xml files to create relative links, e.g. Target=”‘file:///../results/temperatures_by_mode.emf'”
    This seems to work properly, when I open the presentation the image displays (no broken links) and if I put in an updated temperatures_by_mode.emf file, I see that the new file is displayed in the presentation. So far so good. The one strange thing, is that if I click on the “Update Now” button for this link
    File>Edit Links to Files>Update Now then the link breaks.
    Any thoughts for why this would occur?

    • I’m not sure exactly when Microsoft broke this, but they now don’t allow OLE objects to have relative links in current versions of Office. As you’ve noticed, they are deleted on an update. Thanks for drawing my attention to this, I’ve added a notice to the beginning of the article.

      Relative links will still work for other object types, like images, audio and video.

      • Thanks for your reply. Actually, I’m linking to a figure generated in MATLAB and saved as an .emf (enhanced metafile) . So I don’t think it is an OLE object. The edited link seems to work fine, as long as no one presses the “Update Now” button. After that it displays the x The linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verify that the link points to the correct file and location. Maybe Microsoft doesn’t allow relative links to .emf files either. I haven’t tried other formats, e.g. .jpg to see if they would work, but I assume that the same problem would occur for those.

        • I did a test. After Update Now, I got the same result as you. Then I saved and closed the presentation, re-opened it and saw the yellow bar under the Ribbon that says Security Warning References to external pictures have been blocked. Clicking on the Enable Content button makes it reappear. I imagine that updating the linked picture makes PowerPoint block the image, but doesn’t make the security warning appear that would enable you to OK it.

          • Thanks so much for the further clarification of the issue. Although it would be nice to update a figure in a presentation without closing and reopening it, this isn’t really essential. At least clicking the “Update Now” doesn’t permanently break anything. Even if you save the presentation after clicking “Update Now” the links work correctly after you close and reopen the file. So as long as you are aware that the “Update Now” functionality may not work, it is OK. Mostly I want the benefit of having the relative links if the drive mapping changes, and I have that now with your help. Thanks again for your very informative posts, and followup.

  2. I have a complete ppt (some 60 slides, most w charts) linked to excel in (ppt for mac 2016). I’d like to send this plus all data (for future access) to colleagues using my cloud account (either google drive or dropbox). my colleagues can not open the ppt charts as per the above. what would the xml code look like via dropbox or google drive? i’ve granted access to my dropbox folder that houses all files, and they still can not open the ppt/linked charts in excel.

    • File linking uses OLE, a Windows-only technology. Cloud services don’t have OLE, they run on HTTP protocols, not Windows. Users will have to download your files, then re-link them on their desktops using File>Info>Edit Links to Files in the Windows version. Mac users don’t have that utility, but if you place the Excel files in the same folder as the PowerPoint before linking, and Mac users download that folder, the link will often work without editing the XML.

      • I tried taking this advice (moving the excel files to the same folder – within dropbox on my hard drive – then linking the charts, then sharing the dropbox folder, and asking users to download the entire folder, data and powerpoint). Unfortunately my colleagues are still having the same issue – unable to access the charts/data.

        Is there something else I can try – perhaps in the xml?

  3. Hello! Thank you for this article. I’m trying to get this to work in MacOS Catalina with PPT 16.3 and cannot get the relative path to work.

    Here’s what I have: Target=”file:///./Summary_Generator_2020-12-07.xlsx” TargetMode=”External”

    Do you see any errors – or do you know if relative paths no longer work in this version of PPT?

    Thanks!

    • After file:///, you would use 2 dots instead of one. 2 dots stands for the parent directory, 1 dot means the current directory, which in this case is redundant information.

      • I’m still getting the same error that the file does not exist – even though it’s clearly there and named correctly. Any other ideas? Thanks so much.

        • Test conditions: PowerPoint file in subfolder, Excel in parent folder, Excel file inserted as object in PowerPoint on slide 1.

          OOXML edit to slides1.xml.rels: Target=”file:///../2020-sva-department-listing-v2.xlsx”

          Tested as working under both macOS and Windows. Check your quotes, your post is displaying slanted quotes, not straight ones.

          • Perhaps the problem is that I inserted a chart – so I’m actually editing chart1.xml.rels
            Maybe it doesn’t work when I insert the charts this way? In PPT, I have about 40 different charts I’m inserting – all from the same Excel sheet, but I copied and pasted each chart individually – one per slide – so I could tweak formatting etc. Is it possible it doesn’t work within the chart1.xml.rels file…

          • For a relative path to a chart placed on a slide, you’ll still be editing slide1.xml.rels. The path will look like this:

            Target="file:///../ChartSource.xlsx!Sheet1!%5bChartSource.xlsx%5dSheet1%20Chart%201"
  4. whoops – trying agaiin:

    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?”>
    <Relationships xmlns=”http://schemas.openxmlformats.org/package/2006/relationships”><Relationship Id=”rId3″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/image” Target=”../media/image5.jpeg”/><Relationship Id=”rId2″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide” Target=”../notesSlides/notesSlide1.xml”/><Relationship Id=”rId1″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout” Target=”../slideLayouts/slideLayout3.xml”/></Relationships>

    • If that’s the rels file for the correct slide, then you used Paste Special and pasted the chart as an image. Charts pasted as images can’t be linked, so you don’t have an OLE link on that slide and don’t need a relative link.

  5. Ah – I sent the wrong one – but it is still not referencing the .xlsx file – it’s now referencing a .xml

    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <Relationships xmlns=”http://schemas.openxmlformats.org/package/2006/relationships”><Relationship Id=”rId2″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart” Target=”../charts/chart1.xml”/><Relationship Id=”rId1″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout” Target=”../slideLayouts/slideLayout3.xml”/></Relationships>

    I’m pretty sure I’m editing the correct .rels because when I change it, my error message changes accordingly. It just seems not to be able to use the relative paths. It works with a full path, but not a relative one…

  6. Hi, thanks a lot for the article, very helpful.

    I’ve tried to follow it and there was no way of making the relative path work, I always receive the same error message “Sorry, we couldn’t find /OverviewReplies.xlsx. Is it possible that it was moved, renamed or deleted?”.

    In the xml file everything seems to be OK and in the code I have Target=”file:///OverviewReplies.xlsx”.

    It won’t work either in a subfolder. Are relative paths deprecated on the latest versions of PowerPoint? I’m using the latest one, version 16.56 (21121100).

    Kind regards, Antonio.

    • Sorry, but I can’t replicate that result here. If you’re using OOXML Tools for Chrome, try re-opening the PowerPoint file in OOXML Tools to verify that your changes are still in the XML. Currently in OOXML Tools, I have to Save the file, then Download it for the changes to actually be saved. After double-clicking on the linked Excel, macOS should pop up a dialog asking you to give access to the Excel file.

  7. Hi,

    thank you very much for the documentation you put together for these hacks. I’m now trying one of yours to edit the path to the excel file for a chart. Unfortunately, no matter what I change, when I open the presentation, throws the Repair error message at me. I tried the relative path towards the excel file, I tried relative path towards the chart in the sheet in the excel file. I even created a different folder and copied over the excel file and referenced the path to that exact location. Same result every time. It asks me to repair the file. After it’s “repaired” the link no longer exists, even if the path is pointing towards the correct file… I hate Mac! 🙂
    Any ideas to what I’m doing worng?

    Thank you again,
    Radu

    • If an Office program pops up a message about repairing the file, it means you have a mistake in the XML. OOXML editing is unforgiving, because the program doesn’t give any information about what the problem is. The most common error is using curly or “smart” quotes instead of plain straight quotes.

  8. I’m working in Windows and Office365. I have a presentation file that has 86 OLE links to Excel charts. The links are over a network so it takes too long to update. I hoped to hack into the XML and change the Excel references from the network version of the file to the local. I keep getting the “repair” error but I’m not sure why, hoping you can help me out! Thanks in advance, John.

    ORIGINAL:
    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <Relationships xmlns=”http://schemas.openxmlformats.org/package/2006/relationships”><Relationship Id=”rId8″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject” Target=”file:///\\ukitmfs01\ovum\telecoms\Data,%20Forecasting%20&%20Financial%20Analysis\Data\Country%20Updates%20(Slides)\country%20report%20template%202022.xlsx!Key%20Economics%20and%20Demog!R47C3:R54C4″ TargetMode=”External”/><Relationship Id=”rId3″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide” Target=”../notesSlides/notesSlide1.xml”/><Relationship Id=”rId7″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/image” Target=”../media/image15.emf”/><Relationship Id=”rId2″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout” Target=”../slideLayouts/slideLayout18.xml”/><Relationship Id=”rId1″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing” Target=”../drawings/vmlDrawing1.vml”/><Relationship Id=”rId6″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject” Target=”file:///\\ukitmfs01\ovum\telecoms\Data,%20Forecasting%20&%20Financial%20Analysis\Data\Country%20Updates%20(Slides)\country%20report%20template%202022.xlsx!Key%20Economics%20and%20Demog!%5bcountry%20report%20template%202022.xlsx%5dKey%20Economics%20and%20Demog%20Chart%2010″ TargetMode=”External”/><Relationship Id=”rId5″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/image” Target=”../media/image14.emf”/><Relationship Id=”rId4″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject” Target=”file:///\\ukitmfs01\ovum\telecoms\Data,%20Forecasting%20&%20Financial%20Analysis\Data\Country%20Updates%20(Slides)\country%20report%20template%202022.xlsx!Key%20Economics%20and%20Demog!%5bcountry%20report%20template%202022.xlsx%5dKey%20Economics%20and%20Demog%20Chart%203″ TargetMode=”External”/><Relationship Id=”rId9″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/image” Target=”../media/image16.emf”/></Relationships>

    MODIFIED:
    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <Relationships xmlns=”http://schemas.openxmlformats.org/package/2006/relationships”><Relationship Id=”rId8″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject” Target=”file:///C:\Users\Meow\OneDrive\Documents\220421_ExcelPowerpoint\country%20report%20template%202022.xlsm!Key%20Economics%20and%20Demog!R47C3:R54C4″ TargetMode=”External”/><Relationship Id=”rId3″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide” Target=”../notesSlides/notesSlide1.xml”/><Relationship Id=”rId7″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/image” Target=”../media/image15.emf”/><Relationship Id=”rId2″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout” Target=”../slideLayouts/slideLayout18.xml”/><Relationship Id=”rId1″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing” Target=”../drawings/vmlDrawing1.vml”/><Relationship Id=”rId6″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject” Target=”file:///C:\Users\Meow\OneDrive\Documents\220421_ExcelPowerpoint\country%20report%20template%202022.xlsm!Key%20Economics%20and%20Demog!%5bcountry%20report%20template%202022.xlsx%5dKey%20Economics%20and%20Demog%20Chart%2010″ TargetMode=”External”/><Relationship Id=”rId5″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/image” Target=”../media/image14.emf”/><Relationship Id=”rId4″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject” Target=”file:///C:\Users\Meow\OneDrive\Documents\220421_ExcelPowerpoint\country%20report%20template%202022.xlsm!Key%20Economics%20and%20Demog!%5bcountry%20report%20template%202022.xlsx%5dKey%20Economics%20and%20Demog%20Chart%203″ TargetMode=”External”/><Relationship Id=”rId9″ Type=”http://schemas.openxmlformats.org/officeDocument/2006/relationships/image” Target=”../media/image16.emf”/></Relationships>

    • When you’re new to XML editing, making many XML changes at the same time is a sure-fire way to create an error that you can’t find. Instead, start by making one change to one link. Then errors are much easier to track down.

      But you’re using PowerPoint for Windows, which has the File>Info>Edit Links to Files utility. That’s much more user-friendly than editing the XML. I recommend using that.

Leave a Reply

*Required fields. Your email address will not be published.

Posting XML? To enter XML code, please replace all less than signs "<" with "&lt;" and greater than signs ">" with "&gt;". Otherwise, Wordpress will strip them out and you will see only a blank area where your code would have appeared.