How_to_Add_VBA_Code in Power Point Files

nagysm2020 0 views 7 slides Oct 13, 2025
Slide 1
Slide 1 of 7
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7

About This Presentation

How_to_Add_VBA_Code_in_PowerPoint


Slide Content

How to Add VBA Code in PowerPoint Step-by-Step Guide

Step 1: Enable the Developer Tab 1. Go to File → Options. 2. Select Customize Ribbon. 3. Check the Developer option and click OK. → The Developer tab will now appear in your Ribbon.

Step 2: Open the VBA Editor 1. Click Developer → Visual Basic, or press Alt + F11. 2. The VBA Editor (VBE) window will open. 3. This is where you can write or edit your VBA code.

Step 3: Insert a New Module 1. In the VBA Editor, locate your presentation in the Project Explorer. 2. Right-click → Insert → Module. 3. A blank code window appears — paste or write your VBA code here.

Step 4: Example VBA Code Sub HelloWorld() MsgBox "Hello, this is your first VBA code in PowerPoint!" End Sub

Step 5–6: Run and Save the Code • Run the code via F5 or Developer → Macros → Run. • Save your file as a .pptm (Macro-Enabled Presentation). • Regular .pptx files cannot store macros.

Step 7: Adjust Macro Security 1. Go to File → Options → Trust Center → Trust Center Settings → Macro Settings. 2. Choose 'Enable all macros' or 'Disable all macros with notification'.
Tags