How To Extract Image Source Urls From Work Sheet?


Using Excel 2007

I am in the process of converting a static html website to an access database driven site.
Most pages are made up of tables containing text, hyperlinks and small thumbnail images.

I found that I can just copy and paste from the HTML into Excel and I found a macro code on the web to extract the hyperlink url.

But I am having difficulty extracting the image (thumbnail) source url.

I know very little about macro's, can anyone advise what macro code might do the job for me?

Many thanks


Free Excel Help Forum

- Ask any question about Excel and have it answered in no time.

Similar Excel Tutorials

Set a Photo/Image as an Excel Worksheet Background
One of the really cool formatting features of Excel is that you can actually set a picture from your computer as t ...
Add Image Background to a Chart in Excel
How to use an image for the background of a chart in Excel. Simple but fun way to spruce up charts. Click the desi ...
Open PDF from Excel
How to open a PDF file from a clickable button, link, or image in Excel.  This allows you to seamlessly link PDF f ...
Combine Data from Multiple Worksheets in Excel
The easiest way to combine and consolidate data in Excel. Simple method to combine data from multiple worksheets i ...

Helpful Excel Macros

Add Background Photos / Images to Comments in Excel
- Add background images and photos to your comments in Excel with this macro. This macro uses a really cool feature in Ex
Basic Web Query in Excel - Import Data from the Web into Excel
- Import data from the web into Excel with this macro. This is a basic web query macro that will import data from any web
Excel Macro that Searches Entire Workbook and Returns All Matches
- This is the ultimate Lookup Macro for Excel. It will search every worksheet in the workbook and return all of the mat
Get Values from a Chart
- This macro will pull the values from a chart in excel and list those values on another spreadsheet. This will get the s
Remove (Delete) Hyperlinks from Worksheets
- This macro will remove all hyperlinks from the active worksheet. It will delete the hyperlinks but it will not delete t

Similar Topics


I am in desperate need of help Please.
I am using Excel for Mac 2011 and have downloaded an .xls file from my supplier's website.
The first column is meant to contain a thumbnail of an image for each product in the list, but after downloading the file, each image shows a big red cross and states "The linked image cannot be displayed".
I don't necessarily need the image to display but I do need to extract the URL from each image and place it in another column.

I can do this one at a time by right clicking the image file and then selecting "Format Picture". Under "Alt Text" the URL is shown as the "Description".
I take it that the images are not hyperlinked otherwise the URL would be displayed under "Hyperlink" too when right clicking an image?
Due to the fact that there are literally hundreds of products on each downloaded list with multiple variations of each I cannot do this one at a time and need to be able to extract this url information ALLOT quicker.

Is there a function in excel or a macro I can create to allow me to do this?

I have attached a file for reference.



Hi there,

I have a few things i am doing to a worksheet and need a little guidance regarding the possibilities and a bit of help making it happen.

in my worksheet, the first column of every cell (Starting from A21, A22, A23 and so on) i will be inserting a small thumbnail picture apprx size is 1.03cm x 1.23cm (Quite Small). What i would like to achieve is when you click on that picture or double click it enlarges the image to 4.76cm x 5.48cm ( a decent viewable thumbnail image).

My plan once i can get this and another issue i am working on resolved. the worksheet will be converted to a interactive PDF so these images can be clicked to increase size and clicked again to go back to small thumbnail.

I have read another post about this stating "connect the object to a macro that "loads" or hyperlinks to the actual full sized object when clicked on"

But really have no idea how to do this or where to start.

I did find the following whilst search the net for answers but have no clue about VBA

I am using open office (calc) so do not know if i can use Visual Basic and have tried the whole ATL+F11 thing

hi - i have a whole bunch of thumbnail sized images in an excel sheet that are placed there by a third party application (so if they are saved on my hard drive, i do not know the path).

i would like to have some way to click or mouse over them and enlarge them for viewing.

i considered creating a user form to copy and view the image or just writing some VBA to resize the image when it is selected and putting it back when deselected.

I'm guessing someone has done this before, but i haven't found quite what i am looking for in the forums. any help would be appreciated.


I have copied and pasted a big table to excel. All the images have links and I need to extract that URL and post on it's own cell.
I have tried some hyperlink extracting code but I realized the images are not necessarily in a cell.

Is there a way to do this?

and by the way, is the a way to make the images show? I know they are there but they don't show.

I appreciate your help.


Hi all,

I am completely stumped with this problem and not sure where to begin.

I have about 20,000 hyperlinks in my excel sheet that I would like to assign to individual images.

For example, how do I link an image in cell A2, using a hyperlink from cell B2?

I know that if I wanted to simply hyperlink text, I would use =HYPERLINK(B2,"text"), but this reference won't work for images.

I also know I can right click on the image and insert a hyperlink that way, but this obviously isn't practical because I am working with over 20,000 links.

Any help would be appreciated with figuring out this monster of a task, thank you in advance!

This one is driving me crazy. I need to pass the entire HTML source for the URL below to a string variable using Excel VBA. The idea is that I will then parse the resulting string variable to pull out the data I require.

The code I have attempted to use is shown below (also tried using other methods based around .innerhtml - all with same result). This does put some HTML source into the string variable - but it does not capture the full HTML source code that I see when right-clicking on the website and selecting 'view page source'.

In particular, it does not appear to contain the source code for any of the tables which appear on the page - the very same tables I need to pull out figures from. It is very odd, parts of the HTML within the returned string do not even seem to appear in the source code when I right click on the webpage.

All help greatly appreciated.

Many thanks!

Please Login or Register  to view this content.

I need to find a way of creating an inset image on a scatter chart which changes as a result of one of the data points being selected in Excel 2007.

The images will be a .jpg in a defined folder. As the number of data points on the chart is large, it is not really practical to store the images in the workbook itself as there is a different image for each data point.

Ideally, I'm looking for a suitable image control, which I can position in the chart in a blank area, and change the linkage to its source file by VBA driven by the Chart_Select event. Any other mechanism which gave the same 'user experience' would also be OK.

I've tried copy/paste type approaches but these crash Excel completely with no hint as to what it doesn't like.

Any ideas?

Morning all,

I used the usual 'Get external data' route to import to a spreadsheet a series of HTML links, but what I really want is to extract the Javascript from those links. It's curious because I can extract the Javascript by importing the HTML to Word, then copying it, and pasting back to Excel using Paste Special > Unicode/Text.

In vba, I get to PasteSpecial, but can't see a method that can help . . .

I guess the simpler question would be, in Excel or vba, can I Paste Special > Unicode/Text, or extract the Javascript by other means?


Anybody have an image database template to share? Would like to be able to view a bunch of images at one time (eg. put them into comment boxes and show across screen).

Otherwise... here's my dream:

1) Put all my images into one folder
2) Run macro that hyperlinks them into a sheet.
3) In each hyperlinked cell, there will also be a comment for each picture that displays a "preview" image

any help appreciated! thx


I am creating a macro with Excel VBA that will submit an entry into an online database using information from an Excel spreadsheet. During this entry process, the macro needs to click on a CSS button. It isn't a form button, does not have an input type, no name, no id, and no source image except for a background image. I think my only hopes are either to click on the button based on the background image OR based on the div class. Can anyone help?

I think I might be able to use the getElementsByClassName method, since the button is nested in Divs, but I'm not sure! Attached is the source html of the webpage. I removed some confidential information.

The button is he

<div class="choose-type"> 
<div class="mobile"> 
<div class="icon"> 
<a href="/WebObjects/iTunesConnect.woa/wo/"></a> 
<div class="name">iOS App</div> 

If you like these VB formatting tags please consider sponsoring me in support of injured Royal Marines

I'd really appreciate any help! Thank you!


- Some added detail: I can't just navigate to the hyperlink, because the "~/5.." bit is dynamic and randomly generated on each login. And, clicking the CSS button opens a new webpage.

Is there a way to import the source code of a website into excel?

I can do this manually by going to a website, then selecting "View" --> "Source" and then copying and pasting this text into excel. I wondering if there is a macro command that can do this for me automatically everyday.

Once i have the data in excel, I'll be able to extract what i want. I've looked at the web query function in excel but the data i want isn't always in table form.



I have a excel spreadsheet which has many images (500+) in one column, each row. Each image represents a status (there are approx 5 different images). As I would like to be able to sort the spreadsheet, I was wondering if there was any way to convert the image to text. I did some research and the only way I could see is maybe using the alternative text (each png file has different alternative txt depending on the image). I cant find any way just to display the alternative text instead of the image in each cell, so I guess a macro is the best way

When I select on image it says the pictures name is "Picture 1", therefore I would like a macro what selects Picture 1, gets the alternative text, and pasts it in column I, then moves on to "Picture 2" and so on, till they are all done. Not every row has an image (eg. it could be rows 10-30, 50-75...)

Any ideas?

I am using excel 2010 and I need to store images in an excel file (I mean, really store and not to have a link to an image".

Suppose I have an image in "C:\img.jpg".
I insert the image thru the menu (Insert/Image) and then close the excel file and delete the image. If I reopen the excel file I can see the image in it. This means the image is stored in it.

Since I want to execute this process I have recorded the macro getting the following code:



If I execute the above code and then save the excel file and delete the image, when I reopen the excel file instead of seeing the image I get an error message saying that the link to the image is wrong. It clear that in this case the image has not been stored but just the link to it.

Any idea about the way to store images using vba?

I often use excel to do bulk translations of HTML formatted data into other formats.

However, now with Excel 2007, when I paste a block of HTML code from notepad or any plain text editor into excel, excel will actually parse the HTML and display the data as HTML including pictures and fonts. All the source HTML is apparently gone, and all I can see is the output.

Paste special only gives the option of unicode text or plain text and both yield the same results.

This is obviously useless as I can no longer edit the souce text.

I have looked through the MS help files and knowledge base and I have searched these forums, but I still can't find any way to change MS options or preferences to not actually interpret the HTML.

Any thoughts would be greatly appreciated.

I would like to retrieve contents of a web page, be it HTML or XML, into VBA variable!

Later, I would chop, cut, parse or extract the data I need.

Both importing as XML or WebQueries is unsatisfactory for a certain number of pages I need. XML has bad schema, WebQuery tells me it can't find any data.

I tried with WinHTTPRequest, but Excel gives me back error "undefined user type" in other words it doesn't recognize that object.

Basically I want the source of web page to become a string in my VBA code. In other words that would be replication of funcionallity of Code:

urldownloadtofile anyfile.txt

which is provided by AutoHotKey scripting language (if anyone used it, very simple and effective for many things).

Can it be done in Excel's VBA?

I am not sure if this is possible hence my question.

I want to have an excel spreadsheet which will have a word i.e. Cow in Cell A1 and in Cell B1 I want to have a picture of a cow, and repeat this for any number of words and images.

Then I want to be able to randomly produce 3 of these images next to each other elsewhere within the spreadsheet i.e.

(I'd really like to apply a button to allow for the random picture generation to be done by an end user)

Merged Cells A173: E173 - Random Image 1
Merged Cells F173: J173 - Random Image 2
Merged Cells K173: O173 - Random Image 3

The problem is that obviously Excel won't place an image in a single cell so what I have done for Words below will not work

=VLOOKUP(INT(RAND() * MAX(Sheet1!A:A))+1,Sheet1!A1:D$1303, 4, FALSE)

I have found support via the following link but I know little of VBA code so am unable to see how to get it to work for me.
DV0049 - ClipArt Selection

Say I have a picture that also has writing in it, if I resize this picture I want the writing to still be legible. Excel 2007 does this quite effectively, I'm not sure what image rendering/smoothing/anti-aliasing techniques it uses, but the text on the image is still easy to read.

However, when I place an image in a form, and resize it (stretch to fit), no post-processing image rendering is done, and it is nigh impossible to read the text in the image. Is it possible to force Excel to render images in forms in the same rendering engine for images in forms that it uses for images in sheets? Is there anyway to get the images to render in a way that will make the text legible?

Oh, and please don't suggest that I save a copy of the image at a lower resolution, I am dealing with hundreds of images so that isn't feasible.

Hi, I know how to copy text and formulas accross cells and sheets but I could do with being able to do the same with an image.

Is this possible with excel?

Thanks for your help.

I found this other thread but I would need a little hand holding to implement this as i'm a newbie.

as far as I can tell, each entry in a table is like a node contained within the root element in an XML structure. I have figured out how to map my schema on to the table so that each entry and its attributes can be converted into XML. no problem there.

What I'm ghaving trouble wrapping my head around, is how you might describe repeating elements within each of the primary nodes - just as they, the primary nodes themselves are repeating elements. Each of my entries correspond to a project but they could just as easily be imagined as employees in a company. In a case where one might want multiple images for each employee or prject, how would you lay out such a table???

It has also been suggested to me that it makes more sense to do this:

    <!-- As many of these as you need -->

RATHER than this:




I would need to get HTML source code from any given page. I know how to open a HTML page from Excel and I can do it with VBA, but how to get for example this page's source code?

I would start with making a sub that takes a string (the address) as an input parameter and finish with saving the source code of that address as an text file like c:\code.txt

So something like

Dim webaddress as string

Sub GetSourceCode(webaddress)
'then some code to save the source code
End Sub

I have a spreasheet with several workbooks. On Cell B6 of the each of the worksheets I have a reference no. Each reference number has its onw sheet. Depending on the value in cell B6 I would like to create a macro to look for images in C:\Images and return the image matching the reference number.

For Eg if i have "27736" in B6 I would like the macro to look for "27736.jpg" in C:\Images and paste the image in range E3:G10.

Any ideas?

Thank you.

I have a workbook with a custom menu and toolbar. I have assigned icons to the menu and toolbar using existing faceId's. My concern is, if a user has say Excel 2k, another has Excel 2003 and another Excel 2007, would the icons stay the same, assuming that minor changes to the image have occured. The last thing I want to do is code up different faceId's for different versions of Excel.

By minor changes I mean colours updated, perhaps even a slight tweak to the image to make it clearer, but the essential meaning of the icon still remains.

I know that there is a "findcontrol" function I could use, but it would not work so well in my case. I used a macro to extract all icons found and show the faceId's. I just chose the icon that best fit my macro.

I'm using code adapted from Ron De Bruin's site to send messages through Outlook using CDO. I'm using HTML text and have been including an hot-linked image at the end of the message. I just came to realize that not everyone in the distribution list has access to the file share where the image is stored so they do not see the image at all. There is no common file share available and I don't want to ask the network admins to make a change just for this situation.

Is anyone aware of a way to embed the picture into the code, similar to insert - picture - from file, or use an Outlook template that already has the image embedded?

I'm guessing something changed here between Excel 2003 and Excel 2007.

I have an existing VBA macro that grabs some tables from a website that requires you to be logged in.

With Excel 2003 I achieved this by first creating an instance of Internet Explorer (InternetExplorer.Application) and using that to negotiate the login pages & check the 'Remember Me' box etc.
Once all of that was complete my VBA code then closed the IE instance, did some work in the workbook, and then ran the QueryTable.
When Excel ran the QueryTable it presumably used the same cache / cookies (or something else?) as IE, and I was able to grab the tables that I required.

The same macro running under Excel 2007 still manages to create the IE instance and log in etc, however when I come to do the QueryTables Excel reports that the conenction ot the server was successful, but the data was not available, which is what I would expect IF it hadn't logged in correctly.
I can only assume at this stage that the 'Query' from the QueryTables is appearing to the website as a different connection to the one established by the IE instance.

What changed?
What is the work around? (I'm presuming that there IS some way to access pages behind a login screen using 2007!)

In both cases the PC was WinXP SP3 with IE8.


How can I automate importing some files from Excel into Access.

The TransferSpreadsheet Macro Action doesn't allow me to select the range for some reason.

In Tables New - Import Table works perfectly

How can I automate this way of importing Tables to import 200 tables directly from Excel.

I found this

which looks ideal but I can't see a way to save it when I Import Excel (no Advanced tab).

Any ideas? I'm sure I'm missing something obvious.