Office Settings & Configuration

How to Automatically Update PowerPoint Hyperlinks from an Input Using VBA

Muhammad TalhaMuhammad Talha Nov 3, 2026 868 views

Question details

The user wants a PowerPoint hyperlink to dynamically update when a project number is entered into a text box, directing to an external Excel file or SharePoint location.

How to Automatically Update PowerPoint Hyperlinks from an Input Using VBA
Product
PowerPoint
Device & OS
not provided
Scenario
Creating a dynamic presentation where clickable links must change based on user-inputted values, such as a project number.
Observed behavior
The current VBA code fails because it searches for embedded OLE objects (msoLinkedOLEObject) instead of modifying the address property of standard shape hyperlinks.
Before you start

Ensure your presentation is saved as a Macro-Enabled Presentation (.pptm) and that you have enabled macros in your Office Trust Center settings to allow the VBA code to run.

Solution 1Recommended

Modify the VBA Script to Target the Hyperlink Properties

Replace the OLE object check in your VBA macro with code that specifically targets the Hyperlink.Address or Hyperlink.SubAddress properties of the shape.

OLE links and standard hyperlinks are handled differently in VBA. If you are linking out to a SharePoint URL or an external Excel file location, checking for 'msoLinkedOLEObject' will not work.

Instead, your macro should read the text value from the input shape and dynamically update the address property of the target shape's hyperlink.

1
Access the VBA Editor

Press 'Alt + F11' on your keyboard to open the Visual Basic for Applications (VBA) Editor.

2
Locate the Module

In the Project Explorer pane on the left, double-click the module containing your current 'updatelinks' macro.

3
Remove the OLE Object Loop

Delete the 'If pptshape.Type = msoLinkedOLEObject Then' condition, as this ignores standard text or shape hyperlinks.

4
Assign the Hyperlink Address

Write new code to assign the value from your text box to the hyperlink property. Use 'pptshape.ActionSettings(ppMouseClick).Hyperlink.Address = newLinkPath', where 'newLinkPath' is a string combining your base SharePoint/Excel URL with the project number from the text box.

Modify the VBA Script to Target the Hyperlink Properties
Understanding Object Types: Only use msoLinkedOLEObject if your presentation contains actual embedded or linked Excel worksheets natively placed on the slide. For clickable navigation links, always manipulate the ActionSettings or Hyperlink objects.
Efficient Presentation Automation

Automate Hyperlinks with VBA in WPS Presentation

WPS Office offers robust support for VBA macros, enabling you to automate repetitive tasks like dynamically updating hyperlinks, manipulating shapes, and connecting your presentation to external data sources quickly and efficiently.

  1. 1. Open Your Macro-Enabled File: Launch WPS Presentation and open your .pptm file.
  2. 2. Navigate to the Developer Tab: Click on the 'Developer' tab located in the top ribbon menu.
  3. 3. Open the VBA Editor: Click the 'Visual Basic' icon to open the code editor.
  4. 4. Run or Edit Macros: Paste your updated hyperlink VBA code, save the module, and run your macros seamlessly within WPS Office.
Full support for VBA macro execution and editingSeamless compatibility with Microsoft PowerPoint (.pptm) formatsLightweight architecture for faster macro processingFamiliar developer tools and ribbon interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro skip over shapes that have hyperlinks?

If your macro is searching specifically for 'msoLinkedOLEObject', it will ignore standard shapes, text boxes, and images that merely have a hyperlink attached. You need to iterate over 'pptslide.Hyperlinks' or check the shape's 'ActionSettings'.

Can I link directly to a specific tab or cell in an Excel file?

Yes. While the 'Hyperlink.Address' property handles the file path, you can use the 'Hyperlink.SubAddress' property in VBA to specify the sheet name and cell reference (e.g., 'Sheet1!A1').

Will the hyperlink update instantly while I am presenting?

Standard VBA macros do not run automatically upon text entry. To trigger the update during a slideshow, you should assign the macro to an 'Action Button' that the user clicks after typing the project number.