2016年4月29日星期五

Excel VBA : Copy image from website into Excel


Cause:

Wondering how to copy image from a internet source and paste to Excel using the VBA.

There are many examples on the internet if you google "copy image from web vba". However, those are too complicate as I just want to copy from a particular website and particular one image.That's it. No more other things.

So I keep searching on the internet to find a proper method.

One of the method is using "URLDownloadToFile API", it is too complicate for me as I am just a beginner of VBA.....

Then I find a good example from stactoverflow. By using AddPicture(x,x,x,x,) method, it is very easy to copy a image to Excel!

However, you must know the URL of the image first...

Luckily, I know the basic DOM knowlege through my studies on Javascript.



Action:

How to know the URL of the source of the particular image: