Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GIF in userform

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
I've two questions....

1.
Is it possible to use an animating gif in a userform ?
Trying to do this results in a static picture.

2.
Is it possible to change the cursor in a hourglass during the macro-runtime ?
 
2.
Application.Cursor = xlWait

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thnx for your quick response but this doesn't work in a WORD 2003 macro.

Compile error
"Method or data member not found" (Error 461)
 



Please post your code and which statement has this error.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If you're using WORD and userforms then you'd have to use:
Code:
Me.MousePointer = fmMousePointerHourGlass
as vbHourGlass is a VB constant rather than a WORD forms one.

Hope this helps

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Well, next time don't forget to mention the application ...
 
And to answer #1...

No, not that I am aware of. VBA userforms do not support animated GIF. It will be a static image.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
>VBA userforms do not support animated GIF

That's true - but browsers do, and thus so does the DHTML Edit control ... which we can add a reference to and then put on our UserForm
 
VBA userforms do not support animated GIF.
Objection your honors! :)
What you need is the GIF89.dll, which you can download from the net.
Then you set a reference to it in your VBA project.
You need to add the GIF control via "Additional Controls", since it won't appear in your tool box at once.

Then add something like this to your code before the form is shown:
Code:
UserForm1.Gif89a1.FileName = "D:\00_Tools\homer2.gif"
UserForm1.Show

Worked fine for me.
;-)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Knew about putting a browser type control and using THAT for an animated GIF.

Did not know about GIF89.dll.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Just want to add that using GIF89.DLL has some....issues. At least for me. Enough that I simply can not see that it is important enough to use, from a design perspective. Simply not worth it.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Enough that I simply can not see that it is important enough to use

And an animated GIF is important enough?

I hate moving images on what ought to be static screens - and that includes (especially) adverts on web pages.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Tony said:
and that includes (especially) adverts on web pages.
Couldn't agree more with that statement.

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before post
 




helloooooooo wmbb!!!

Are you there?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
0002039E.gif


What's wrong with a totally annoying moving gif on a user form?
 
I rest my case.
Tony said:
And an animated GIF is important enough?
No...that was my point. It is not (IMO), from a design point of view. Because of issues with GIF89, I fail to see that having an animated...well, anything, is important enough.

And somebody hunt down ettienne and shoot him/her. Or claw him/her.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Sorry for my late reaction but due to the illness of my little daughter I had not much time for my hobby.

And to your questions...
...no it's not that important but I wanted to draw extra attention to a field using a moving arrow.
If it is not possible in a simple way, I will use a static image instead.

Thanx for all your responses
 
Well GIF89.DLL does work, but it seems a little flakey to me, and it does bring in the question of whether any other person has it registered for use on their computer. If they do not...poof, there goes any advantage.

Or, as is the case with many networks, a user may not be able to get GIF89 for use. I have sneaky admin rights at work, so I was able to test it out, but 99% of our users do not, and could not, get GIF89 to be available. This to means limits its usefulness.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
...no it's not that important but I wanted to draw extra attention to a field using a moving arrow.
A moving arrow? I wouldn't use an animated gif for that then. It's like shooting nukes at a bunch of pigeons.

For that simple task I would rather try to emulate an "animation" by using a halfed arrow, a timer, and switching the colouring of the two halfs. Or by using one arrow on a label and alternatingly make that label visible/invisible, giving it a blinking effect.

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top