Inserting Image Into Cell From URL Graphical Error?

Lewzerrrr

Active Member
Joined
Jan 18, 2017
Messages
256
Hi,

I have a big piece of code that inserts pictures into a template using an URL, now sometimes it works and then somehow offsets itself upon the next run and I'm unsure why.

This is the code simplified but on the line of..

Code:
Set Pic = .Parent.Pictures.Insert(URL)

It doesn't paste directly into the top left as it should? It pastes a little offset down and to the right..

Full simplified code.

Code:
Sub Test()

URL = "http://media.topshop.com/wcsstore/TopShop/images/catalog/TS01G08NBLK_Large_F_1.jpg"


Set PicPosition = template.Cells(5, 3)


With PicPosition


.Select


Set Pic = .Parent.Pictures.Insert(URL)


    With Pic
    
        .Top = Pic.Top + 8.7
        .Left = Pic.Left + 26.1
        .Width = 92.6929242
        .Height = 100.629933
        
    End With


End With


Set Pic = Nothing


End Sub

Any help?

** UPDATE **

When I create a copy of the sheet, it fixes it on the next sheet and looks exactly how it should do, can't understand why? But on the original sheet, when I changed the zoom from what it was it auto-corrects itself, so is this a graphical bug as even printing is perfect, it's just on screen it looks messed up.

Thanks,
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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