Change PowerPoint links to Excel workbooks with VBA
Posted on 2009-06-29
I have a presentation with a number of links to Excel workbooks/sheets. I can get to these through Edit... Links... and change them one at a time. I need to change the location of the workbooks, so I'd like to do them all at once programmatically. The tricky part here is that the filenames contain ranges, not just an Excel workbook name.
I tried replacing just the directory spec using something like this:
.LinkFormat.SourceFullName = newPath & oldXLFN
I get an error message that says I can't do this because the filename is already open. I'm supposing that when I open the PPT presentation, that the links are then opened at the same time.
Is there some easy way to make this directory change in VBA? Each presentation has about 15 links and we have a number of presentations to update.
Thanks in advance for the help.