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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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