• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Retrieving a Picture from an Image Host to insert into Header

Sean

New Member
Hi:

I have a procedure that inserts a company logo into the header of each sheet in a workbook--It currently points to:

.filename="C:\Users\sean.VFC\Desktop\RW_LOGO_Final_edited-3.jpg"

In order to make this available to those using other machines, I am hosting the image on a hosting site (PhotoBucket) that provides a URL link--

??How do I modify my vba to find this picture and insert it ??--

Code:
Sub Each_Sheet()
   Dim ws As Worksheet
   ForEach ws In ThisWorkbook.Worksheets
        ADDLOGO ws
   Next ws
EndSub

PrivateSub ADDLOGO(ws As Worksheet)
With ws.PageSetup.LeftHeaderPicture
        .Filename = "C:\Users\sean.VFC\Desktop\RW_LOGO_Final_edited-3.jpg"
        .Height = 32
        .Width = 33
     
        .ColorType = msoPictureAutomatic
     
        .CropBottom = 0
        .CropLeft = 0
        .CropRight = 0
        .CropTop = 0
   EndWith
   With ws.PageSetup.RightHeaderPicture
        .Filename = "C:\Users\sean.VFC\Desktop\RW_LOGO_Final_edited-3.jpg"
        .Height = 32
        .Width = 33
     
        .CropRight = -36
     
        .ColorType = msoPictureAutomatic
     
        .CropBottom = 0
        .CropLeft = 0
     
        .CropTop = 0
   EndWith


    ws.PageSetup.LeftHeader = "&G"
    ws.PageSetup.RightHeader = "&G"
EndSub

I posted this earlier, but some of the particulars changed (location of picture, etc.)--

If there is no way to use the host link, then any suggestions to solve the problem would be appreciated--

Thanks Again--
 
Back
Top