Author Topic: Animated GIF on userform  (Read 6623 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
Animated GIF on userform
« on: August 24, 2007, 11:04:19 AM »
I want to put an animated GIF or AVI on a userform in my spreadsheet, and I want it embedded into the userform i.e. no extraneous files to send with the spreadsheet.

Any ideas?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Guest

  • Guest
Re: Animated GIF on userform
« Reply #1 on: August 24, 2007, 11:16:04 AM »
I did this a while ago; just sort of playing around with VBA.  If I remember correctly, I had to add a web page control to the form.  As for the gif, I don't know if it can be embedded.

I'll see if I still have the code.

Guest

  • Guest
Re: Animated GIF on userform
« Reply #2 on: August 24, 2007, 11:25:16 AM »
AH HA!!

You have to add the Microsoft Web Browser control.

Code: [Select]
WebBrowser1.Navigate "e:\temp\animated.gif"
However, it doesn't appear that you can embed the GIF into the browser or form.  Also, when you do this, the horizontal and vertical scroll bars show up.  Not very pretty.

There might be some APIs for doing this though.  Not sure.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
Re: Animated GIF on userform
« Reply #3 on: August 24, 2007, 11:28:24 AM »
I tried the webbrowser control, and I can eliminate the scroll bars, but the result is that I have to send the file out with the spreadsheet.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Guest

  • Guest
Re: Animated GIF on userform
« Reply #4 on: August 24, 2007, 11:31:23 AM »
Just thinking out loud here...

Is it possible to insert the GIF into a sheet, then HIDE that sheet so no one can see it, and somehow reference that "hidden" gif??

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
Re: Animated GIF on userform
« Reply #5 on: August 24, 2007, 11:37:54 AM »
maybe ... lemme work on that
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Dave R

  • Guest
Re: Animated GIF on userform
« Reply #6 on: August 27, 2007, 08:25:47 AM »
Keith -

A quick Google for Excel userforms and AVI's led me to this. You can probably extract what you need from the code in the excel sheet.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16727
  • Superior Stupidity at its best
Re: Animated GIF on userform
« Reply #7 on: August 27, 2007, 08:37:45 AM »
Cool, that is a pretty straightforward method .. hadn't thought of creating a window in that manner ... now I just need to be able to embed the avi into the spreadsheet.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal