Results 1 to 10 of 10

Thread: Animated GIF

  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Animated GIF

    Is there any way to place an animated gif on a userform?

    Thanks!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    Add an image control to your userform (e.g. Image1). Set the image control's picture property to the Gif file, using
    (e.g. the gif file is in the same directory as the workbook):

    GifFileName = ThisWorkbook.Path & "Example.gif"
    Image1.Picture = LoadPicture(GifFileName)

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    Hans, What event is this code to be placed under? and Will it animate my animated GIF? [img]/forums/images/smilies/smile.gif[/img])

    Thanks Millions!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    Put this code in the initiate event of the userform. Just try it out, I do not have much experience with animated gifs, but this is the way you put a gif on a userform. I thought that the animation was in the gif, so I expect it should work.

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    Hrm.... No animation... Anyone else have any ideas? [img]/forums/images/smilies/smile.gif[/img])

    THANKS!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  6. #6
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    I just found out that the way I proposed indeed creates a static image. This is an area that seems to be overlooked by Microsoft. In Excel 5/95 you could copy a "live" chart into a dialog sheet. Dialog sheets can still be used in Excel 97 or 2000, so, maybe (although I don't know how) there is a chance that you can do it via a dialog sheet.

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    I'm looking at the possiblity of adding a webcontrol to the form.. i'll keep everyone apraised!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    I've got a webcontrol, but am not sure how to specify that a gif is to be loaded into it... so i'm stuck again..

    thanks!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  9. #9
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    If I can't setup an animated gif to 'play,' can you think of a way to unload/load a set of gifs to make it resemble "Animation?"

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  10. #10
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Animated GIF

    I was able to do it.. very chunky.. but done..

    ***CODE START***
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Private Sub UserForm_Activate()
    DoEvents
    Image1.Visible = True
    Sleep 100
    DoEvents
    Image1.Visible = False
    Image2.Visible = True
    Sleep 100
    DoEvents
    Image2.Visible = False
    Image3.Visible = True
    Sleep 2000
    Unload Me
    End Sub
    ****CODE END****
    Then I had to put all my images directly on top of each other, or if you wanted to simulate an object moving, you could just place them sequentially where-ever you want.

    If anyone has a better idea, i'm all ears!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •