logo
search
Office Settings & Configuration

How to Export Visible Slides with Hidden Backups in PowerPoint VBA

Muhammad TalhaMuhammad Talha Oct 14, 2026 869 views

Question details

The user needs to create separate PowerPoint presentations using VBA, where each new file contains a single visible slide paired with its subsequent hidden backup slide, while maintaining the hidden status.

How to Export Visible Slides with Hidden Backups in PowerPoint VBA
Product
Microsoft PowerPoint
Device & OS
not provided
Scenario
Running a VBA macro to split a large presentation into smaller files containing specific visible and hidden slide pairs, but the macro is incorrectly separating or skipping the hidden slides.
Observed behavior
The macro either outputs four separate files (detaching the hidden slides from their visible counterparts) or skips the hidden slides entirely due to restrictive conditional filtering in the code.
Before you start

Before modifying your VBA macro, save a backup copy of your master presentation in a safe location, as macro actions cannot typically be undone via the standard undo button.

Solution 1Recommended

Adjust the VBA Macro Logic to Group Visible and Hidden Slides

Remove the conditional statements that exclude hidden slides from the VBA loop to ensure they are processed and kept with their corresponding visible slides.

When writing macros to process presentation decks, checking slide visibility is common. However, if your goal is to explicitly include hidden backup slides alongside visible ones, filtering them out will break the pairing logic.

By modifying the slide loop and utilizing the SaveCopyAs method, you can accurately split the deck into the desired paired files.

1
Open the VBA Editor

Press Alt + F11 in PowerPoint to launch the Visual Basic for Applications editor, then locate the module containing your export macro.

2
Locate and Remove the Visibility Filter

Find the line of code that reads `If Not oSld.SlideShowTransition.Hidden Then`. Delete or comment out this line entirely.

3
Remove the Corresponding End If

Scroll down to the end of that conditional block and delete the matching `End If` statement to prevent syntax errors during execution.

4
Implement the SaveCopyAs Method

Ensure your code logic duplicates the presentation, deletes unrelated slides to leave only the target visible slide and its hidden counterpart, and then uses `Presentation.SaveCopyAs` to generate the new file.

5
Verify Formatting and Run

Check your code for any unintended blank lines or formatting errors introduced by copying from forums. Save your macro and run it to verify that two files are created, each containing a paired visible and hidden slide.

Adjust the VBA Macro Logic to Group Visible and Hidden Slides
Preserved Hidden Status: Using this approach guarantees that the SlideShowTransition.Hidden property remains active in the newly exported files, exactly as required.
Efficient Presentation Management

Manage and Export Slides Seamlessly with WPS Presentation

WPS Presentation provides advanced developer tools and an intuitive interface, allowing you to easily manage slide visibility and run VBA macros for complex export scenarios.

  1. 1. Download and Install WPS Office: Download WPS Office and open your master presentation file in WPS Presentation.
  2. 2. Access Developer Tools: Navigate to the 'Developer' tab on the main ribbon to access the VBA environment.
  3. 3. Run Your Export Macro: Click 'Macros', input or paste your adjusted slide-pairing VBA code, and click 'Run' to generate your separated files.
  4. 4. Manual Alternative: If you prefer not to use VBA, simply hold Ctrl to select your visible slide and its hidden backup, copy them, and paste them into a blank presentation, preserving original formatting.
Fully compatible with Microsoft PowerPoint formats (.pptx, .ppt, .pptm)Built-in Developer tab supporting macros and VBA automationLightweight architecture for faster processing of large presentationsFree to use with comprehensive presentation design and management tools
microsoft office alternative - wps office

Frequently Asked Questions

Why is my PowerPoint macro ignoring hidden slides entirely?

Your macro likely includes a condition such as `If Not oSld.SlideShowTransition.Hidden Then`. This explicitly tells the code to skip any slide marked as hidden. Removing this condition will allow the code to process hidden slides.

Does exporting a hidden slide automatically make it visible in the new file?

No. When you duplicate a presentation or copy-paste slides using VBA or manual methods, the slide's visibility properties (such as the Hidden status) are preserved in the destination file.

What is the best VBA method to save portions of a presentation?

The most reliable method is to duplicate the entire presentation, delete the slides you do not need in the copy, and then use the `Presentation.SaveCopyAs` method to save the result as a new file without overwriting your original.

Why is my VBA code throwing a syntax error after removing the hidden slide filter?

If you remove an `If` statement, you must also remove its corresponding `End If` statement later in the code. Failing to do so breaks the code's structure and triggers a block syntax error.