Solved Saving an unlinked copy of a linked PowerPoint file

Microsoft Office 2007 small business - u...
October 3, 2012 at 02:40:09
Specs: Windows XP, Intel Core2 3GB RAM
Hi and thanks in advance for any help you can offer
I have created an Excel workbook that is used by sales reps to model budget impacts for a wide range of different organisations. The rep can then generate a PowerPoint presentation with multiple links back to the workbook to leave with the organisation.
The problem is that every time the customer opens the saved presentation, they are asked to update links, which is a nuisance. I found some VBA code on the forum that I have linked to a button to automatically break the links (see below) but the reps need to first save the PowerPoint as a copy first, in order that the linked template is still available for the next time they run the program. It turns out that they sometimes forget to do this, thus preventing the template from updating the next time they try to use it!
Is there a way I can add some lines to the VBA code so that when they press the button it will automatically force a “save as” before breaking the links in the copy, leaving the original unchanged?

Here is the code I am using:
Sub BreakLinks()
Dim oSld As Slide
Dim oShp As Shape
Dim oCmdButton As CommandBarButton
Set oCmdButton = CommandBars("Standard").Controls.Add(ID:=2956)
ActiveWindow.ViewType = ppViewSlide
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = msoLinkedOLEObject Then
ActiveWindow.View.GotoSlide oSld.SlideIndex
End If
Next oShp
Next oSld
End Sub

See More: Saving an unlinked copy of a linked PowerPoint file

October 3, 2012 at 05:52:49
✔ Best Answer
1 - Open the VBA editor to edit your macro.
2 - Start a new line below:

Dim oCmdButton As CommandBarButton

3 - Type in the instruction Save
4 - With your cursor anywhere within the word Save, press F1
5 - Read the Help page for Save
6 - You might also want to read the Help page for SaveAs

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

October 3, 2012 at 07:05:51
Thanks a lot - that seems to do the trick!

Is there any way I can save the file as a macro enabled file (pptm)? I have tried specifying the format as ppFormatXMLPresentationMacroEnabled but when I try to run the macro it tells me that I am not licensed to use the control. Am I doing something wrong?

Report •

October 3, 2012 at 08:57:00
I don't do much with PPT VBA...mostly stick to Excel.

I found this via a Google search on saving macro enabled PowerPoint files with VBA:

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question