VBA & Macro Problems

How to Fix VBA Error -2147467259 When Updating PowerPoint Links

Camila MilosovichCamila Milosovich Oct 26, 2026 868 views

Question details

Users encounter a runtime error when running a macro that updates source links for Excel objects in a PowerPoint presentation.

How to Fix VBA Error -2147467259 When Updating PowerPoint Links
Product
PowerPoint / Excel
Device & OS
not provided
Scenario
Executing a VBA macro designed to automatically update OLE links between an Excel workbook and a PowerPoint presentation.
Observed behavior
The macro halts execution and throws runtime error '-2147467259 (80004005)' due to an incorrectly formatted or invalid source file path.
Before you start

Verify the exact file path and name of your source Excel workbook, ensuring the file has not been renamed, moved, or deleted from its original directory before running the macro.

Solution 1Recommended

Validate and Construct the Complete File Path in VBA

Fix the macro code by ensuring the folder path, filename variable, and file extension are accurately concatenated without missing slashes.

The -2147467259 error typically indicates that the macro is passing an invalid string to the OLE link update method. This happens when a filename variable is empty, a directory slash is omitted, or the file extension is forgotten during path concatenation.

1
Open the VBA Editor

Press Alt + F11 on your keyboard while in your presentation to launch the Visual Basic Editor.

2
Locate the Path Variable

Find the module and subroutine where the link update is occurring, and identify the variable holding your source file path.

3
Correct the String Concatenation

Ensure you include trailing slashes and the correct file extension. For example: nouveau_chemin = "C:\Users\Desktop\Folder\" & FileNameVar & ".xlsx".

4
Add a File Check

Implement the Dir function to verify the file exists before updating the link by adding: If Dir(nouveau_chemin) <> "" Then

5
Test the Macro

Run the macro again to confirm the link updates successfully without throwing the 80004005 runtime error.

Validate and Construct the Complete File Path in VBA
Print Your Path String: Use 'Debug.Print nouveau_chemin' to output the exact string your macro generates to the Immediate Window. This helps quickly identify missing slashes or typos.
Advanced Macro Support

Debug and Run VBA Macros Smoothly with WPS Office

WPS Office provides robust built-in support for VBA macros. You can seamlessly edit, debug, and execute your automated scripts to update OLE links between spreadsheets and presentations.

  1. 1. Enable Developer Tools: Open WPS Presentation, navigate to the Tools tab, and select Developer to access macro options.
  2. 2. Open Visual Basic Editor: Click on 'Visual Basic Editor' on the ribbon to view and modify your existing VBA code.
  3. 3. Debug the Path String: Use the Immediate Window (Ctrl+G) to test your path variables and ensure the file location is perfectly formatted.
  4. 4. Execute the Macro: Run the corrected script to automatically update your embedded Excel data links seamlessly.
Fully compatible with Microsoft Office VBA scripts, including .pptm and .xlsm formats.Built-in Visual Basic Editor for easy macro debugging and variable inspection.Lightweight suite with fast execution for cross-application automated tasks.
microsoft office alternative - wps office

Frequently Asked Questions

What does VBA error 80004005 indicate?

Error -2147467259 (80004005) is an unspecified OLE or COM error in VBA. In the context of updating presentation links, it almost always means the macro is trying to resolve a file path that is incorrectly formatted, missing, or inaccessible.

How can I check the exact file path my macro is generating?

You can add the line 'Debug.Print your_path_variable' just before the link update command in your VBA code. This will print the generated string into the Immediate Window (press Ctrl+G in the editor to view it), allowing you to visually spot missing slashes or incorrect extensions.

Can I use relative paths to prevent this error on other computers?

Yes. Instead of using a strict absolute path like 'C:\Users\Name\Desktop', you can use 'ActivePresentation.Path & "\filename.xlsx"' to dynamically fetch the folder where your presentation is currently saved. This ensures the link updates smoothly on any device as long as the files are kept together.