Obscure Excel VBA error: “Invalid Picture”

As many of the frequenters of this great place will know, Charles Williams and I created The Excel Name Manager. The # 1 (FREE) tool on the web to work with defined names in Excel.

Well, we do occasionally get feedback on this tool (which is always appreciated!) and in all these years, we got two reports stating the tool didn’t work at all, showing an “Invalid Picure” error which effectively prevented the tool from working.

So this appears to be a rather obscure error.

Colin Delane was kind enough to help me troubleshoot this problem (as he was the one experiencing it).

After some detective work, we nailed down the problem to one particular commandbutton on the NM’s main form. This button has a picture (as the others on the top have too):

Screenshot of Name Manager buttons. I circled the offending button. Note that this button only shows in the FastExcel version of NM.

The odd thing is, that it appeared to be the format of the picture that was causing havoc.

Both Meta and BMP are OK (no error on user’s system), but when we loaded a GIF picture format, the error occured reproducably.

Has anyone seen this before?

Regards,

Jan Karel Pieterse
www.jkp-ads.com

3 Comments

  1. Bastien says:

    Hello Jan Karel,

    I’ve expercienced the same.

    In the past I have received this error from people that use ASAP Utilities. In that case it was the use of GIF-images on userforms. If I remember correctly I used a GIF-image as a picture on a commandbarbutton. (I nearly always use GIF-images for pictures with a limited number of colors because of its reduced filesize and sharpness)

    What I did to solve the error was replacing the GIF-images with BMP-images.
    Microsoft addresses this problem only with the Mac version of Excel and the solution they give is to use BMP images too. (http://support.microsoft.com/default.aspx?scid=kb;en-us;175918)

    Kind regards,
    Bastien

  2. Marcus says:

    Hi Jan Karel,

    I’ve also experienced this issue about 8 years ago. We had a company logo as a GIF on an Excel report. When the user went to print preview Excel would crash after displaying a similar message. We finally tracked it down to their Windows colour depth setting.

    The GIF image could only accommodate 256 colours. This user had their machine set to true colour even though the company standard was 256 (1999 remember).

    Once the user changed their colour setting back to 256 the issue disappeared. While we could (and probably should) have simply change the image format, bureaucracy won and the user was compelled to accommodate the IT dept rather than the other way around.

    Regards – Marcus

  3. Markus says:

    I had the same problem with my add-in on a tchec windows xp system. The VBA-Form did not load and fired the message. The reason was a GIF with transparent background. I removed it and replaced it by a BMP with grey background. That worked fine.

Posting code or formulas in your comment? Use <code> tags!

  • <code lang="vb">Block of code goes here</code>
  • <code lang="vb" inline="true">Inline code goes here</code>
  • <code>Formula goes here</code>

Leave a Reply

Here's how to update your reports of company and nearly any web data: