Insert.Pictures returns suddenly a 1004 error

Juriaan

New Member
Joined
Dec 15, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Dear all,

I hope you can help me with an issue I have.
I had a perfect working piece of code that fetches an online picture (value in cell) and posted this in certain file. Never had any issues.
Since December it gives me the 1004-error "Unable to get the insert property of the picture class".
In addition when I run the macro on a Mac computer it is working fine. So I can't figure out what has changed. I tried different references but nothing helps.

Does somebody had similar experience in the past? And how did you manage this?

VBA Code:
Sub PastePic()

    If Picture_URL <> "" Then
        Set pic = ActiveSheet.Pictures.Insert(Picture_URL)
        With pic
            .ShapeRange.LockAspectRatio = msoFalse
            .Height = ActiveCell.MergeArea.Height
            .Width = ActiveCell.MergeArea.Width
            .Top = ActiveCell.MergeArea.Top
            .Left = ActiveCell.MergeArea.Left
            .Placement = xlMoveAndSize
        End With
    End If
End Sub
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Welcome to the MrExcel Message Board! :)

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Welcome to the MrExcel Message Board! :)

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Ok thx will make sure to this!
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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