Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3671910
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:32:41+00:00 2026-05-19T02:32:41+00:00

Has anyone had problems inserting a PNG file into a word document, using a

  • 0

Has anyone had problems inserting a PNG file into a word document, using a VBA Macro?

I have an MS Word document that contains a very large directory listing of image files, inside a table. I’ve been asked to update the document by inserting the corresponding image in front of the name.

Now, if I enter the image manually (using Insert|Image|From File), I’m able to successfully place the PNG image … so I decided to write a quick VBA Macro to insert the image for me. The following is a sample of the code:

Dim myFile  As String
Selection.SelectCell
Selection.Copy
myFile = _
   Chr(34) & "C:\Documents and Settings\...\Project\Images\" _
   & Left(Selection.Text, Len(Selection.Text) - 2) & Chr(34)

Selection.InlineShapes.AddPicture _
   FileName:=myFile, LinkToFile:=False, SaveWithDocument:=True

Outcomes:

  • Whenever I execute the macro, I get the “Unable to Convert” error dialog, and no image is inserted.
  • I even changed the code to invoke the wdDialogInsertPicture Dialog instead, and it worked just fine.

This is very confusing … using a manual process, the insert works, but going with an automated solution, the insert doesn’t work!

Any ideas or suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:32:41+00:00Added an answer on May 19, 2026 at 2:32 am

    I’ve tried the macro several times and it works … it seems that I’m no longer able to re-create the error again. So, I’m going to mark this under the “mysteries of Office VBA” column and leave it as is … this is not a high-priority project, so there is no need for me to continue investigating.

    Thanks to Alain and Joel Spolsky for their help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone else had any problems using google's Domain Tracking API, I am specifically
Has anyone had a chance to dig into how F# Units of Measure work?
Has anyone had any experience targetting WSH in the way that VBScript , JScript
Has anyone had experience using these two technologies in tandem? What are (if any)
Has anyone had any success running two different web servers -- such as Apache
Has anyone had success automating testing directly on embedded hardware? Specifically, I am thinking
Has anyone had luck with removing large amount of issues from a jira database
Has anyone had any experience in building a 'real world' application with the Smart
Has anyone had any experience scaling out SQL Server in a multi reader single
Has anyone had any luck with querying/changing SPNs on a Windows domain? Most of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.