Solved

Change PowerPoint links to Excel workbooks with VBA

Posted on 2009-06-29
4
738 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

705 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now