Roshan Valecha
New Member
Hello Everyone!
I am working on a macro that would allow me to extract pictures from a website for Price Comparison purposes.
I have managed to extract pictures from a few websites or from Google Images for example but I am having difficulties with the following website:
"http://fr.louisvuitton.com/images/is/image/lv/1/PP_VP_AS/louis-vuitton--M41746_PM2_Front view.jpg" as an example.
It seems that the webpage has to be loaded to "generate" the picture.
This is the error message I get:
"Run-time error '1004':
Insert method of Pictures class failed"
I have looked around on this forum and others, but it seems that the issue here is different to what I have found online.
These are the two different macros I tried working with:
You will find the two macros under the document attached to this post. I am using Excel 2013.
Thank you in advance for your help.
I am working on a macro that would allow me to extract pictures from a website for Price Comparison purposes.
I have managed to extract pictures from a few websites or from Google Images for example but I am having difficulties with the following website:
"http://fr.louisvuitton.com/images/is/image/lv/1/PP_VP_AS/louis-vuitton--M41746_PM2_Front view.jpg" as an example.
It seems that the webpage has to be loaded to "generate" the picture.
This is the error message I get:
"Run-time error '1004':
Insert method of Pictures class failed"
I have looked around on this forum and others, but it seems that the issue here is different to what I have found online.
These are the two different macros I tried working with:
Code:
Public Function InsertPicSKU()
On Error GoTo ErrHandler
ActiveSheet.Pictures.Insert ("http://fr.louisvuitton.com/images/is/image/lv/1/PP_VP_AS/louis-vuitton--M41746_PM2_Front%20view.jpg")
Exit Function
ErrHandler:
MsgBox "Error: Photo not found for " & SKU
End Function
Code:
Sub shape()
Sheets(1).Shapes.AddPicture "http://fr.louisvuitton.com/images/is/image/lv/1/PP_VP_AS/louis-vuitton--M41746_PM2_Front%20view.jpg" _
, msoFalse, msoTrue, 100, 100, 500, 600
End Sub
You will find the two macros under the document attached to this post. I am using Excel 2013.
Thank you in advance for your help.