-1

As the the title suggests, I am dealing with a WebP image online. The file name ends in .jpg, but it's a WebP image.

I would like to insert this image in an excel sheet using "ActiveSheet.Pictures.Insert". My code works well for actual .jpg images, but it doesn't work for this image. I can only suspect it's because it's a WebP image (I got error code 1004: "Unable to get the Insert property of the Pictures class").

Is there anyway in Excel/VBA to deal with WebP images? I've tried to look into FreeImage but I am not familiar with any of this. If I understand I can use FreeImage as a plug-in which allows me to convert an image? I downloaded the .zip-file with the program and the documentation, but I did not really feel like I had the knowledge to adequately use it.

Thanks for your attention!

Wobzter
  • 11
  • 3

1 Answers1

0

As of today, you don't.

It's not currently on the list of supported types:

https://learn.microsoft.com/en-us/deployoffice/compat/office-file-format-reference

I recommend you convert the image to JPG or BMP format before you insert the image.

HackSlash
  • 4,944
  • 2
  • 18
  • 44
  • Do you know any way to automate that? I need to go through many images. For example, would it be possible to convert it using PowerShell and plug in some PowerShell in VBA? – Wobzter Jan 27 '21 at 23:15
  • There are many options. Here is the first thing that came up on google: https://github.com/sndnvaps/webp2jpg – HackSlash Jan 28 '21 at 16:26