TheSwamp

Code Red => VB(A) => Topic started by: Keith™ on August 24, 2007, 11:04:19 AM

Title: Animated GIF on userform
Post by: Keith™ 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?
Title: Re: Animated GIF on userform
Post by: Guest 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.
Title: Re: Animated GIF on userform
Post by: Guest 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.
Title: Re: Animated GIF on userform
Post by: Keith™ 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.
Title: Re: Animated GIF on userform
Post by: Guest 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??
Title: Re: Animated GIF on userform
Post by: Keith™ on August 24, 2007, 11:37:54 AM
maybe ... lemme work on that
Title: Re: Animated GIF on userform
Post by: Dave R on August 27, 2007, 08:25:47 AM
Keith -

A quick Google for Excel userforms and AVI's led me to this (http://xcelfiles.homestead.com/AVI.html). You can probably extract what you need from the code in the excel sheet.
Title: Re: Animated GIF on userform
Post by: Keith™ 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.