Abegail0203
New Member
- Joined
- Mar 6, 2022
- Messages
- 11
- Office Version
- 2010
- Platform
- Windows
Hi,
I have an existing macro that convert the path in a cell into a picture. The problem with my macro is that everytime i delete the file in jpg format in the folder/path location after running the macro, the picture inserted in the spreadsheet is no longer displayed. The error says "The linkage image cannot be displayed. The file may have been moved, renamed or deleted.
I am asking your assistance what code should be inserted in order for the images to no longer dependent on the original path because the original location should remain empty after embedding the picture/image inside the spreadsheet.
Here's my existing code:
Dim P As Object
For Each Sheet In Sheets
Sheet.Activate
On Error Resume Next
Range("A12").Select
Set P = ActiveSheet.Pictures.Insert( _
Range("A12").Value _
).Select
Cell A12 is where the path is written. Some of the sheets have path in range A12, some don't have that is why i use the "FOR EACH SHEET IN SHEETS".
Thank you in advance
Aby
I have an existing macro that convert the path in a cell into a picture. The problem with my macro is that everytime i delete the file in jpg format in the folder/path location after running the macro, the picture inserted in the spreadsheet is no longer displayed. The error says "The linkage image cannot be displayed. The file may have been moved, renamed or deleted.
I am asking your assistance what code should be inserted in order for the images to no longer dependent on the original path because the original location should remain empty after embedding the picture/image inside the spreadsheet.
Here's my existing code:
Dim P As Object
For Each Sheet In Sheets
Sheet.Activate
On Error Resume Next
Range("A12").Select
Set P = ActiveSheet.Pictures.Insert( _
Range("A12").Value _
).Select
Cell A12 is where the path is written. Some of the sheets have path in range A12, some don't have that is why i use the "FOR EACH SHEET IN SHEETS".
Thank you in advance
Aby