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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,224,814
Messages
6,181,126
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