Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Change PowerPoint links to Excel workbooks with VBA

Posted on 2009-06-29
4
Medium Priority
?
754 Views
Last Modified: 2012-05-07
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.
Tom
0
Comment
Question by:thomasedooley
4 Comments
 

Accepted Solution

by:
thomasedooley earned 0 total points
ID: 24745088
I think I found the problem. All day yesterday I was trying this, and getting the message that said "you already have a copy of this file open" as I stated above.

When shutting down my machine before going home, I got a spurious "do you want to save the changes made to thisfile.xls" from Excel (which was the linked Excel file I'm using in the PPT).

I tried this again this morning, and lo and behold, the code works (.linkformat.sourcefullname).

We can close this as solved by me, or delete it.

I appreciate the work put in by any experts on this problem, and would happily give points.

thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question