Stop "The linked image cannot be displayed" message from showing on screen,

DannyDont

New Member
Joined
Mar 7, 2014
Messages
40
This message appears whenever I attempt to insert an image that does not exist. This I would expect except until recently it did not display. I would like to know how I can stop this error message from being displayed. I apologize as I do not know how to include code in a message so I will copy and paste.
VBA Code:
    If Pref_DC_Special = "Y" Then
        Image_Column1 = Range("A" & Control_Row_Value - 3)
        Image_Column2 = Range("B" & Control_Row_Value - 1)
        Range("A" & Control_Row_Value - 3 & ":" & "B" & Control_Row_Value - 1).Merge
        Range("A" & Control_Row_Value - 3 & ":" & "B" & Control_Row_Value - 1).Select
...
    Selection.Value = ""
    Control_Row_Height = Selection.RowHeight                        'Save to reset original height if no image
    Image_Width_Cell = Selection.Width
    Image_Height_Cell = Selection.Height
    UTY_Ans = Pref_Image_Directory & "\" & ToShow_Img & ".JPG"
Debug.Print UTY_Ans
    On Error GoTo Process_Image_Err
'        Application.ScreenUpdating = False
'        Application.DisplayAlerts = False
    ActiveSheet.Pictures.Insert(UTY_Ans).Select        NOTE: This code looks a bit off but has not been changed and works for all "found" images.
'        Application.ScreenUpdating = True
'        Application.DisplayAlerts = True
    On Error GoTo 0
    Selection.ShapeRange.Height = Image_Height_Cell - 2
    If Selection.ShapeRange.Width > Image_Width_Cell Then Selection.ShapeRange.Width = Image_Width_Cell - 2
'   ======================================================
'   Code below is to get info to center the image in its space
'   ======================================================
    Image_Width_Image = Selection.ShapeRange.Width
    Image_Height_Image = Selection.ShapeRange.Height
    If Image_Height_Image + 5 > Control_Row_Height Then
        Image_Height_Cell = Image_Height_Cell + 5
        Rows(Control_Row_Value).RowHeight = Image_Height_Cell
    End If
    Image_Position_Right = (Image_Width_Cell - Image_Width_Image) / 2
    Image_Position_Down = (Image_Height_Cell - Image_Height_Image) / 2
    Selection.ShapeRange.IncrementLeft Image_Position_Right
    Selection.ShapeRange.IncrementTop Image_Position_Down
    Exit Sub
...
Here is a snapshot of the output.
1650384232659.png

Previously, I simply added the "Image Not Found" in the merged area reserved for the image. Thanks for any help you might provide. I am wondering if something has changed with the process of handling shapes or images?

I hope I have done this properly.
 
Last edited by a moderator:
Will send you a pm with observation notes and issues I'm having with running your app. My notes are quite long and won't be helpful to anyone following this thread.
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top