Copying a picture from a web page and pasting into Excel

tom566

New Member
Joined
Jul 1, 2011
Messages
4
Hi there, ive been looking all over the internet for answers to my problem but could find none.

I need to be able to copy a specific graph, in the form of an image, from a page. This image always has the same name, "itmu-cpu-generic-lastweek." I already have to code to create an instance of internet explorer and go to the page, but cannot find how to copy that one image and not the whole page.

I guess it does not really matter if it is copied to the clipboard or saved to the computer, as long as it is on my computer so that excel may grab it and throw it into a cell. Any help will be greatly appreciated
smile.gif
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Does the image have a static (i.e. unchanging) URL? If so, copy the URL to the clipboard, then in Excel: Insert - Picture - From File - paste the URL as the File name - Insert.
 
Upvote 0
Nope, the url is not always exactly the same, which is giving me the problem. I do know the name of the image on the page as I mentioned above, and the name never changes. Is there any way for me to grab the picture by just knowing this information?
 
Upvote 0
It's difficult to help you without knowing the URL of the web page containing the image, or the HTML code surrounding the image. As a guess you would probably need to extract the src=xxxx string from the < IMG > tag.
 
Upvote 0
John, I'm have a similar issue trying to load or save an image from a page. I am using a google static maps api and creating the addresses dynamically from a form. A sample would be:

http://maps.googleapis.com/maps/api...=14&size=512x512&maptype=roadmap&sensor=false

What is returned is a page with a single static image file on it. I would like to save this image to the same path as my activeworkbook programmatically. Any ideas?
 
Upvote 0
Try URLDownloadToFile (search for examples). ActiveWorkbook.Path is a string containing the folder path of the current workbook.
 
Upvote 0
Thank you!! I think I've got it figured out with the exception I have a username and password issue getting the program to dynamically connect to the net. I'm using 2000 so the example I had for passing the username and password wasn't working.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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