We Value Your Privacy

We and our partners use technology such as cookies on our site to personalise content and ads, provide social media features, and analyse our traffic. Click below to consent to the use of this technology across the web. You can change your mind and change your consent choices at anytime by returning to this site.

Update Consent
Loading ...

How to Insert Animated GIF Files in Excel

Updated February 21, 2017

Animated graphics interchange format (GIF) image files are simple animated movie files that work by rotating through a single sequence of GIF images. Microsoft Excel allows you to display an animated GIF image that is contained on your hard drive in any Microsoft Excel worksheet. In order to embed an animated GIF file, you'll need to know the full location and name of your GIF file, and you'll need to insert a snippet of virtual basic code into your Excel spreadsheet.

Loading ...
  1. Navigate to the folder that contains your animated GIF file. Write down the full path name of the folder and the name of the file. For example, if the file is contained in a subfolder of your C: drive called Pictures and the file name is bear.gif, then the full path name would be c:\pictures\bear.gif.

  2. Open the Microsoft Excel document to which you would like to add your animated GIF.

  3. Click on the "View" menu and choose "Toolbars" => "Control Toolbox."

  4. Click on the top button in the "Control Toolbox," which activates "Design Mode." "Design Mode" allows you to draw an item in your spreadsheet that may receive an object such as an animated GIF.

  5. Click on the bottom button in the "Control Toolbox," which has a hammer. From the drop-down menu, select "Microsoft Web Browser." This activates "Microsoft Web Browser" controls, which can be used to view animated GIFs.

  6. Left-click and hold down your mouse button on the location in your spreadsheet in which you would like to embed the animated GIF. Draw a box that is large enough to contain the animated GIF image.

  7. Click on the "Design Mode" button again to disable design mode. Close the "Control Toolbox" toolbar.

  8. Hold down the "Alt" key on your keyboard and press the "F11" key. Doing so will open a Microsoft Visual Basic window within Excel.

  9. Double-click on the worksheet to which you are adding your animated GIF in the Project list in the upper-left corner of the Visual Basic window. This will open a Visual Basic Code window.

  10. Copy and paste the following code into the Code window:

  11. Private Sub Worksheet_Activate()

  12. End Sub

  13. Change the path name and filename in quotes to the appropriate path for your animated GIF file.

  14. Click to a different worksheet, and then click back to the worksheet to which you added the GIF. The animated GIF should be visible in the object box that you drew.

Loading ...

About the Author

Dan Howard is a sports and fitness aficionado who holds a master's degree in psychology. Howard's postgraduate research on the brain and learning has appeared in several academic books and peer-reviewed psychology journals.

Loading ...