Fix Macros Not Displaying Pictures in Word or Excel
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.

- 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.
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.
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.
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.
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.
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.

Verify Trust Center Settings in Excel
Check Excel's security settings to ensure macros have the required permissions to execute and import external picture files.
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. Download and Install: Visit the official WPS website to download and install WPS Office on your computer.
- 2. Open Your Document: Launch WPS Writer or Spreadsheet and open the file containing your VBA macros.
- 3. Run the Macro: Enable macro content when prompted and run your picture insertion scripts with confidence.

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.




