4

I have an Excel macro that opens a PowerPoint file from a specified location. The PowerPoint file is a template.

I need to create a new presentation based on the template design.

My code will open the template rather than a new presentation based on that template:

Sub Open_PowerPoint_Presentation()
    'Opens a PowerPoint Document from Excel
    
    Dim objPPT As Object
    
    Set objPPT = CreateObject("PowerPoint.Application")
    objPPT.Visible = True
    
    'Change the directory path and file name to the location
    'of your document
    
    objPPT.Presentations.Open "C:\Users\Colin\Documents\Custom Office Templates\PowerPoint Templates\Edge45 Monthly Report Template Macro.potm"
    
End Sub

1 Answer 1

6

In my opinion, you should open your template file with the Untitled parameter (Open method) set to true.

objPPT.Presentations.Open FileName:="MyTemplate Macro.potm", Untitled:=msoTrue

According to Presentations.Open Method (PowerPoint),

Opens the file without a title. This is equivalent to creating a copy of the file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.