• Giff..is this possible (Excel 2000)

    Author
    Topic
    #366364

    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

    Viewing 0 reply threads
    Author
    Replies
    • #568006

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

      • #568051

        Use a Microsoft WebBrowser control to display the gif on your userform. –Sam

        • #568106

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

          • #568116

            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:

            Option Explicit
            Private Sub UserForm_Initialize()
                WebBrowser1.Navigate "file://C:NiuB.gif"
            End Sub

            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

            • #568135

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

            • #568166

              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 download.com.

              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!

            • #568175

              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

            • #568208

              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!

            • #568238

              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

            • #568243

              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.

            • #568239

              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

    Viewing 0 reply threads
    Reply To: Giff..is this possible (Excel 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: