To insert an animated gif image in an Excel workbook, the reflex is to insert the menu / image, but it does not work. This is normal because the animation is done by multiple images and importation is limited to the first.
To make the animation work, you must insert the image into a control.
- To insert the control, go to the View menu / Toolbars / Control Toolbox
- Activate the first button "creation mode"
- Choose the last button (the one with a hammer), then choose "Microsoft Web Browser"
- Then draw a frame for the image.
- Disable the first button "design mode" and the toolbar.
- Finally, in the VBA editor and in the window of the leaf concerned paste the following code:
Private Sub Worksheet_Activate ()
WebBrowser1.Navigate "X: \ path of the image. GIF"
End Sub- Change the active page of the workbook, and then return to the worksheet to see the animation moving image.
- To add other events, we must proceed in the same way each time adding a line to the code above, taking into account the control number assigned.
WebBrowser 2. Navigate "X: \ path of the image. GIF"- To insert other animations on other pages, you must do the same by adding the VBA procedure on each page.
Bookmarks