Home > Excel Tutorial > Adding Animated Gif Image In Worksheet

Adding Animated Gif Image In Worksheet

The animated gif can be added in Excel sheet with “Microsoft Web Browser” Control.To insert this control:

  • Go to View > Toolbars > Control Toolbox
  • Activate Design mode
  • Choose the last button (hammer picture), then select “Microsoft Web Browser”
  • Draw a frame for the image (animated gif)
  • Disable Design mode and the toolbar
  • Paste the following code in the VBA editor:
Private Sub Worksheet_Activate()
WebBrowser1.Navigate “about:<html><body scroll=’no’><img src=” & ThisWorkbook.Path & “\ani.gif> </img></body></html>”
End Sub

Change the active sheet of the workbook, and then turn on the sheet containing the animation, to see  if it works.
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: