VBA & Macro Problems

Add a Date, Footer, and Slide Number to PowerPoint Slides with VBA

Natalie TaylorNatalie Taylor Nov 18, 2026 868 views

Question details

Add a footer, creation date, and slide number to PowerPoint slides created by an Excel VBA macro.

Add a Date, Footer, and Slide Number to PowerPoint Slides with VBA
Product
Microsoft Excel and Microsoft PowerPoint
Device & OS
not provided
Scenario
An Excel macro creates PowerPoint slides and needs to display footer information on each new slide.
Observed behavior
Each generated slide should show custom footer text, a fixed creation date, and its slide number.
Before you start

Open the PowerPoint presentation that the Excel macro will use, and confirm that macros are permitted in Excel. In the VBA editor, check Tools > References for the Microsoft PowerPoint Object Library if your code uses PowerPoint-specific types and constants.

Solution 1Recommended

Set footer, date, and slide number properties in Excel VBA

Use this method when your Excel macro already creates or selects a PowerPoint slide.

1
Open the macro

In Excel, open Developer > Visual Basic and locate the procedure that creates the PowerPoint slide.

2
Set the slide properties

After the line that assigns the new slide to PPSlide, add: With PPSlide.HeadersFooters .Footer.Visible = msoTrue .Footer.Text = "My Text" .DateAndTime.Visible = msoTrue .DateAndTime.UseFormat = msoFalse .DateAndTime.Text = "Created " & Format(Now, "mm/dd/yyyy") .SlideNumber.Visible = msoTrue End With

3
Run and inspect the macro

Run the procedure from Excel's Developer > Macros dialog, then open the generated slide in PowerPoint to check the footer, date, and slide number.

Set footer, date, and slide number properties in Excel VBA
The creation date is fixed: The code writes the current date as text when the macro runs. It does not automatically update on subsequent days.
Free Microsoft Office alternative

Add Slide Dates and Numbers with WPS Presentation

WPS Office is a free, lightweight alternative for working with presentations and spreadsheets in a familiar interface. Open existing Office files and add slide information manually; WPS does not fix Microsoft PowerPoint or Excel VBA automation.

Add dates, footer text, and slide numbers to presentations manuallyOpen and edit Microsoft PowerPoint PPT and PPTX filesWork with Microsoft Excel XLS and XLSX filesUse a familiar interface for a smoother move from Microsoft Office
microsoft office alternative - wps office

Frequently Asked Questions

Where should I put the footer code in my Excel macro?

Place it after the statement that creates or selects the slide and assigns it to PPSlide. That ensures the HeadersFooters settings apply to the intended slide.

Will the creation date update automatically?

No. Setting DateAndTime.UseFormat to msoFalse and assigning DateAndTime.Text stores a fixed text value when the macro runs.

Why is the slide number missing even though Visible is set to msoTrue?

Check the slide's layout under View > Slide Master for a slide-number placeholder. Also check Insert > Header & Footer and whether Don't show on title slide is selected.

Why does Excel not recognize the PowerPoint object types?

In the Excel VBA editor, open Tools > References and select the Microsoft PowerPoint Object Library. The example uses PowerPoint-specific types such as PowerPoint.Slide.