Results 1 to 12 of 12
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Giff..is this possible (Excel 2000)

    Hello again ,


    I can make animation using 3 static pictures and make them
    looks like moving on userform..but how do i make an already
    animated giff (single picture)..ie..let say i d/load this picture (single picture) from internet to behave like it should do (moving) .thanks and hope this is possible.cheers


    ps: refer to attachment the picture that i attached to my userform are suppose to move like image below...but when i attached it to a userform,its not moving..how do i make it move to be like it should be
    Attached Files Attached Files

  2. #2
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Giff..is this possible (Excel 2000)

    This is the picture that I attached to my userform in my wb..its not moving on the userform like it should be
    Attached Images Attached Images

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Giff..is this possible (Excel 2000)

    Use a Microsoft WebBrowser control to display the gif on your userform. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Giff..is this possible (Excel 2000)

    thanks sam..could you please elaborately more details coz i have no idea at all..please..and thanks

  5. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Giff..is this possible (Excel 2000)

    1) Remove the image control, it dosn't do gifs.
    2) Display the toolbox
    3) Right-click the toolbox & press additional controls
    4) Check the Microsoft web browser
    5) Add the control to your form
    6) Use the navigate method to load your gif:<pre>Option Explicit
    Private Sub UserForm_Initialize()
    WebBrowser1.Navigate "file://C:NiuB.gif"
    End Sub</pre>


    Note: I got rid of the scrollbar by making the control a little wider than the form. If the gif is just a small part of the userform, then you can hide the scrollbar by placing it into a frame that is narrower that the control. HTH, see attached. --Sam
    Attached Files Attached Files
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  6. #6
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Giff..is this possible (Excel 2000)

    thanks sam. i will try it and tell u the result. regards and cheers

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

    Re: Giff..is this possible (Excel 2000)

    Nuib, I've taken this road before...

    While sam's option will likely work, it may not work if you have to distribute this to many users.

    You want the animation to display all the time? there's a way you can accomplish this visually, and with three frames, it shouldn't be too difficult.

    First, break out the three images that create the animated .gif. (If you don't already have good software to do this, you can download XaraX (Trial) or Paint Shop Pro(Trial) from <A target="_blank" HREF=http://www.download.com>download.com</A>.

    Then, place all three images directly on top of each other in your form.

    Private Sub UserForm_activate()
    Do
    DoEvents
    Image3.Visible = False
    Image1.Visible = True
    DoEvents
    Sleep 45
    Image1.Visible = False
    Image2.Visible = True
    DoEvents
    Sleep 45
    Image2.Visible = False
    Image3.Visible = True
    DoEvents
    Sleep 45
    Loop

    I can't offer any advice on how to break out of the loop, but that will make the image appear to be animated. Increasing or decreasing the sleep values will make the object go faster or slower.

    This may hijack your code if you're doing other complex things though, for me, it's working great as a splash screen for my Gargantuan Tracking System...

    Hope that helps!
    <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
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Giff..is this possible (Excel 2000)

    thanks drkrealm, but the code i'm using right now eventually is your code..lol..its true..thats why i'm trying to use single giff that i have d/load and try to make it animate it.but so far , still failed. your code works fine drkrealm, but i try to manipulate the giff that have been built by other ppl , but seems like a dead end.anyway thanks for your response.cheers and regards

  9. #9
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Giff..is this possible (Excel 2000)

    Hi Folks,

    I couldn't help fiddling with the ideas presented here. DrkRealm's approach is fine for GIF's with only a few frames. In the attached, I generalized the approach so you could use any (reasonable) number without having to fiddle with the code. When you add the pictures to the form, change the Tag property to the name of the next image containing the next frame. For the last image, change the Tag property to the image containing the first frame. I created this example from an animated GIF that orignally had 20 frames.

    Asides: 1) When the delay between frames is smaller, the smoothness of the animation depends on other system activities. For example, when the delay is 1 (millisecond), the animation goes slowly when the mouse is idle, and rapidly when the mouse is moving. 2) I don't know what the implications are for an application, the fact that the loop has no exit condition. I tried Loop Until frmMoebius.Visible = False, but if you use the X to close the form, you get an automation error (I suppose because the object no longer exists to test whether it is visible or not).

    Anyway, I had fun doing it!
    Attached Files Attached Files

  10. #10
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Giff..is this possible (Excel 2000)

    Nice solution, Jim, and a good use of the Tag property. It's interesting though, if I right-click and save your attachment, then it works; however, if I click on the attachment link and let IE5 run your file, then when I close the userform, IE hangs. I'll try it with IE6 tomorrow. Guess we're pushing the envelope. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  11. #11
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Giff..is this possible (Excel 2000)

    NiuB, did you get the browser to work? I had trouble modifying your original attachment. I would suggest that you start all over again. Remember that my attachment expects to see the giff in C:NiuB.gif, so you would have to distribute two files or have the gif on a server. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  12. #12
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Giff..is this possible (Excel 2000)

    Hi Sam,

    Excel sort-of hangs too, but it's not as obvious or disasterous. For example, open the downloaded file, close the form, then try Alt+F11 - it doesn't work. Instead, choose Tools (menu), Macro, Visual Basic Editor. Notice that the Run button is grayed out, indicating something is running. Click the Stop button and things come back to life. This happens because, even though the form is closed, that loop is still going(!)

    My guess is, opening it in IE doesn't give you back enough control when you want it, whereas in Excel you can do things because of the DoEvents.

Posting Permissions

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