0
votes

My day to day work involves creating powerpoints for clients highlighting their campaign performance. Most of the charts have been linked to excel, which saves me a ton of time but I end up spending time updating the images in the powerpoint.

In order to preserve the size and postion of images, i use the change picture option when you right select the picture and paste in the link like this: https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-snc6/9943_10151547582895095_1006500471_n.jpg. All the links are ordered in excel which is given by the client.

I have already gone through a similar post here: Using VBA to insert/update image in PowerPoint?, but i was looking for a solution where the pictures get updated based on the links in excel. Any help here would be appreciated.

1

1 Answers

0
votes

I found the answer at a different website. Posting it here in case anyone else is looking at solving the same challenge:

Sub recupererImageWeb_WinHttp()
'activate library : Microsoft WinHttp Services ,version 5.1
Dim b() As Byte
Dim h As Long
Dim oWinHttp1 As WinHttp.WinHttpRequest
Dim dex As String

dex = Worksheets("Sheet1").Cells(2, 11).Value

h = FreeFile
Open "C:\AAAA - Report\WWWWorkflow\cover.jpg" For Binary As #h

Set oWinHttp1 = New WinHttp.WinHttpRequest
oWinHttp1.Open "GET", _
dex, False

oWinHttp1.Send
oWinHttp1.WaitForResponse (30)
b() = oWinHttp1.ResponseBody

Set oWinHttp1 = Nothing
Put #h, 1, b()
Close #h



End Sub