karamarrott
New Member
- Joined
- Jan 26, 2023
- Messages
- 5
- Office Version
- 365
- 2019
- Platform
- Windows
I have a report that needs pictures imported regularly. I have a Macro that will delete the pictures in a column and then import new ones. However, using the button back to back will eventually give an error of "1004 Unable to get TOPLEFTCELL properly of picture class."
Is there a way to rewrite the picture delete VBA or some kind of error in the code?
Also I have version 2019 while others that use the file have 365 could this cause an issue?
Thank you
Is there a way to rewrite the picture delete VBA or some kind of error in the code?
VBA Code:
Set xRg = Range("AZ3:AZ14")
For Each xPic In ActiveSheet.Pictures
Set xPicRg = Range(xPic.TopLeftCell.Address & ":" & xPic.BottomRightCell.Address)
If Not Intersect(xRg, xPicRg) Is Nothing Then xPic.Delete
Next
On Error Resume Next
Also I have version 2019 while others that use the file have 365 could this cause an issue?
Thank you