Insert Gif into sheet and View it userForm

Thamizh_S

New Member
Joined
Mar 10, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
1615383496811.png

I Want to insert all listed Gifs from a folder into Spreadsheet, then by selecting a Gif, and then by clicking the command button in the sheet an user Form should pop-up and display the Gif.
I tried to display the Gif directly in the userform using Webbrowser object. It was working. But i dont know how to do this one.
Code I used to display GIF in UserForm,


Private Sub UserForm_Activate()

WebBrowser1.Navigate2 (ActiveWorkbook.Path & "\" & "1.gif")
'WebBrowser1.Document.Body.Scroll = "no"
Call MakeFormResizable
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
With WebBrowser1
.width = 1024
.Height = 768
.Document.Body.Scroll = "No"
End With
End Sub

In this I directly encoded the Gif name, but now i want to do it more interactive way.
1. Insert Gif into Spreadsheet.
2.Select the Gif manually.
3.Click command button
4. An user form needs to display the Gif.

Kindly Let me know is it possible. also do share some code snippets that will be really helpful.
Thanks in advance.

Regards,
Thamizh
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Watch MrExcel Video

Forum statistics

Threads
1,129,714
Messages
5,637,940
Members
416,993
Latest member
ant8989

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
Top