Excel 2013 The Linked image cannot be displayed the file may have been moved, rename

kumar lama

Board Regular
Joined
May 20, 2014
Messages
85
I Got this error in excel 2013, previously i was working in excel 2007, the code was working perfectly. in excel 2013 i receive this massage " The Linked image cannot be displayed the file may have been moved, rename Or Delete. Verify that the link points to the correct file and location.
I have Below Code. How can i fix It? Pls Help Me
Thank You!!

Option Explicit
Sub just4you()

Dim objNewPic As Object
Dim picToOpen As String

On Error Resume Next
' Setting Of picToopen String As The Application That Will Open The Picture
picToOpen = Application _
.GetOpenFilename("Pics (*.jpg), *.jpg")
If picToOpen <> False Then
' Setting The Opened Picture Into A Cell Range
Set objNewPic = InsertPictureInRange(picToOpen, _
Range("A1:H19"))
End If
End Sub
Function InsertPictureInRange(PictureFileName As String, TargetCells As Range) As Object
' inserts a picture and resizes it to fit the TargetCells range
Dim p As Object, t As Double, l As Double, w As Double, h As Double
If TypeName(ActiveSheet) <> "Worksheet" Then Exit Function
If Dir(PictureFileName) = "" Then Exit Function
' import picture
Set p = ActiveSheet.Pictures.Insert(PictureFileName)
' determine positions
With TargetCells
t = .Top
l = .Left
w = .Offset(0, .Columns.Count).Left - .Left
h = .Offset(.Rows.Count, 0).Top - .Top
End With
' position picture
With p
.ShapeRange.LockAspectRatio = msoFalse
'my code
.Left = Range("K5").Left
.Top = Range("K5").Top
'your code....
.ShapeRange.Width = 85#
.ShapeRange.Height = 100#
End With

Set InsertPictureInRange = p
Set p = Nothing

End Function
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Mr Andrew Poulsom I dont have problem with Code. when i work with my file its working fine but Once i close and reopen and i got this Error.
" The Linked image cannot be displayed the file may have been moved, rename Or Delete. Verify that the link points to the correct file and location" .
I tried what i can, but unable to fixed it.
 
Upvote 0

Forum statistics

Threads
1,216,041
Messages
6,128,467
Members
449,455
Latest member
jesski

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