Google Sheets IMAGE Function

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
291
Office Version
  1. 365
Platform
  1. Windows
Is there any way to replicate the IMAGE function from Google Sheets in Excel? Maybe a VBA code? From what I can tell, the function in Google Sheets takes a URL and imbeds that image into a cell, not a hovered object like Excel would. The syntax is =IMAGE(url, [mode], [height], [width]). An example pulling in Google's logo is =IMAGE("https://www.google.com/images/srpr/logo3w.png").
 
Dan W, this works great! Man, I wish I had the VBA skills to do this! Is there a way I can compensate you for your effort?
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
No, no, none of that - thank you, though. I'm just glad it works! I'm still not entirely happy with it, though, so will likely tinker with it. It would be great, though, if you could please let me know if you come across any bugs.
 
Upvote 0
BTW, I tried the URLs with the old code you had sent and they didn't work either. Is it an issue of jpg vs png? When I paste the URLs in a browser I do get images.
 
Upvote 0
Hmm - so I tried inserting the photo 'manually' by using VBA (sometimes there are limits to what can be done with a worksheet formula/function), and VBA/Excel reported back that the image wasn't found:
1642099566779.png

Let me look into it.
 
Upvote 0
Click on either of the links I sent to you and an image will appear in your browser.
 
Upvote 0
Yeah - I did see that - they definitely exist, but I just trying to work out why Excel thinks that they don't.
 
Upvote 0
Shouldn't be an issue with png v jpg. They're both supported image types.
Annoyingly, I just realised I used a outdated method inserting images - it still doesn't solve the problem of inserting those two images (which might be an issue re: timeouts, not sure yet), but it is something I need to fix. Will update code in a few hours after dinner. In the meantime, can you please check with other images from different sources to see what does/doesn't work? I had tried a dozen or so using images from blogs (including this forum), but I hadn't tried the Amazon servers.
 
Upvote 0
Ok - it can be done. I've yet to work out why, but Excel doesn't like those two images and won't import them directly into the spreadsheet. It can be done by first downloading the image and then adding it the spreadsheet, but let me dig into it a bit more once I'm back.
 
Upvote 0
The option of downloading them first unfortunately won't work for the project I'm doing. I have 1,500+ lines on my report with URLs and I need to pull in the image from the web. Downloading them will add too much time to the process. If that's the only way, then this just may not work. I truly appreciate your time on this. Do you think it's due to the file type png vs jpg?
 
Upvote 0

Forum statistics

Threads
1,223,639
Messages
6,173,499
Members
452,517
Latest member
SoerenB

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