VBA & Macro Problems

Fix Macros Not Displaying Pictures in Word or Excel

Kushani NimanthikaKushani Nimanthika Oct 12, 2026 871 views

Question details

The user needs to fix an issue where pictures inserted using VBA macros are not visible or fail to persist after the document is saved and reopened.

How to Fix Macros That Do Not Display Pictures in Word or Excel
Product
Word and Excel
Device & OS
not provided
Scenario
Executing a VBA macro to automatically insert images into a Word document or Excel spreadsheet.
Observed behavior
Pictures inserted by the macro remain invisible, fail to insert completely, or disappear entirely after saving and reopening the file.
Before you start

Verify that your image files are not corrupted, are saved in standard formats like JPEG or PNG, and that you have the correct file paths specified in your macro code.

Solution 1Recommended

Adjust Picture Formatting and Embedding in Word VBA

Modify your Word VBA macro code to embed pictures directly and set them inline with text to prevent display issues.

Pictures inserted as floating shapes or linked to temporary local paths often disappear when the document is moved or saved. Embedding the image inline ensures it remains a permanent part of the document structure.

1
Use the InlineShapes Method

Update your VBA code to use 'InlineShapes.AddPicture' instead of 'Shapes.AddPicture'. This inserts the image directly 'In Line with Text', which is much more stable for displaying graphics.

2
Force Image Embedding

Ensure your code includes the parameters 'LinkToFile:=False' and 'SaveWithDocument:=True'. This forces Word to save a copy of the image inside the document rather than referencing an external file path.

3
Check Image Size and Format

Make sure your macro points to standard, reasonably sized JPEG or PNG files, as excessively large images or unsupported formats can cause the VBA execution to fail silently.

Adjust Picture Formatting and Embedding in Word VBA
Code Implementation: Testing your updated macro with a small, locally saved PNG file can help quickly verify that the embedding parameters are working correctly.
Free Microsoft Office alternative

Experience Reliable Macro Execution with WPS Office

If you continue experiencing issues with VBA macros failing to display pictures in Microsoft Word or Excel, consider trying WPS Office. It provides a lightweight, highly compatible alternative with excellent support for standard Office formats and macro execution.

  1. 1. Download and Install: Visit the official WPS website to download and install WPS Office on your computer.
  2. 2. Open Your Document: Launch WPS Writer or Spreadsheet and open the file containing your VBA macros.
  3. 3. Run the Macro: Enable macro content when prompted and run your picture insertion scripts with confidence.
Highly compatible with Microsoft Office formats like DOCX, XLSX, and macro-enabled filesSeamless execution of standard VBA scripts in advanced versionsLightweight design ensures fast loading of large documents and imagesFamiliar user interface makes migration effortless and quick
microsoft office alternative - wps office

Frequently Asked Questions

Why do pictures inserted by my macro disappear after I save the document?

This usually happens because the macro is configured to link the image to a local file path (LinkToFile:=True) instead of embedding it (SaveWithDocument:=True). When the document is saved and reopened, or moved to another computer, the link to the original image breaks.

Why do images inserted via VBA show up as blank boxes?

Blank boxes can appear if the image is too large, the file format is unsupported, or if the 'Show picture placeholders' setting is enabled in your Word Advanced Options. Try using smaller JPEG or PNG files.

Can Trust Center settings block picture insertion in Excel?

Yes, strict Trust Center macro settings can block external scripts and restrict access to local files. Ensuring your macros are enabled and the file locations are trusted can resolve these security blocks.

Should I use Shapes or InlineShapes to insert pictures in Word VBA?

For most standard document layouts, it is best to use InlineShapes.AddPicture. This inserts the picture directly in the text flow, which is generally much more stable and prevents images from disappearing or floating off-page.