Results 1 to 10 of 10

Thread: [RESOLVED] Excel VBA Userform Gif Problem - Dropdowns Corrupted

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2024
    Posts
    6

    Resolved [RESOLVED] Excel VBA Userform Gif Problem - Dropdowns Corrupted

    Hello, I can't get gifs to work in my userform..

    It seems the Webbrowser plugin which can display animated gifs through the userform, has some unintended behaviour towards the mouse or something.. basically drop-downs can only be selected using the keyboard after it's run!

    https://www.youtube.com/watch?v=LFltyIBXCGc

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,363

    Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted

    I made a simple animated gif control for VBA using twinBASIC (so it's x64 compatible too, I tested in 64bit Office actually), if you can use ocxs.

    The decades-outdated built in web browser control is barely usable at this point... not sure anything can even be done about bizarre side effects like that.

    Anyway, control: https://github.com/fafalone/ucAniGif

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2024
    Posts
    6

    Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted

    Quote Originally Posted by fafalone View Post
    I made a simple animated gif control for VBA using twinBASIC (so it's x64 compatible too, I tested in 64bit Office actually), if you can use ocxs.

    The decades-outdated built in web browser control is barely usable at this point... not sure anything can even be done about bizarre side effects like that.

    Anyway, control: https://github.com/fafalone/ucAniGif
    Thank You for your response, I believe you have responded to me previously on reddit!

    https://www.reddit.com/r/vba/comment..._userform_but/

    Regretfully your github project seems too technical for my brain to comprehend. It seems I may have exhausted options, so perhaps I can periodically investigate your solution over the coming years and see if I can make sense of it.

  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,363

    Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted

    ? You can either just download the .ocx file from the Releases link, matching Office for 32bit or 64bit, and drop it on regsvr32.exe (in SysWOW64 for 32bit, System32 for 64bit).

    Or open the source file in twinBASIC, select 'win32' or 'win64' from the dropdown in the toolbar to match your Office type, then File->Build, and it will automatically create and register the ocx.

    Then you select ucAniGif from Tools->Additional controls in Excel VBA.

    You can't use the source code as-is in VBA; VBA doesn't support creating UserControls. You could theoretically use oleexp.tlb (32bit only) or make a typelib (if 64bit) to replace mDefs and implement the code directly reusing the core parts, but that's far more difficult than just downloading and registering or compiling my project as described above.

    I guarantee the above is simpler than the assembly-code debugging and memory patching that would be the only possible avenue of fixing the issue with the WebBrowser control, lol.

    PS- Yep your post on reddit that was me... sorry I never saw your reply about your confusion on how to use it. Some time ago I ignored my notifications for a while and it built up to the point where I kept ignoring it, so most of the time unless I remember to revisit a post I don't know about replies

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2024
    Posts
    6

    Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted

    Quote Originally Posted by fafalone View Post
    ? You can either just download the .ocx file from the Releases link, matching Office for 32bit or 64bit, and drop it on regsvr32.exe (in SysWOW64 for 32bit, System32 for 64bit).

    Or open the source file in twinBASIC, select 'win32' or 'win64' from the dropdown in the toolbar to match your Office type, then File->Build, and it will automatically create and register the ocx.

    Then you select ucAniGif from Tools->Additional controls in Excel VBA.

    You can't use the source code as-is in VBA; VBA doesn't support creating UserControls. You could theoretically use oleexp.tlb (32bit only) or make a typelib (if 64bit) to replace mDefs and implement the code directly reusing the core parts, but that's far more difficult than just downloading and registering or compiling my project as described above.

    I guarantee the above is simpler than the assembly-code debugging and memory patching that would be the only possible avenue of fixing the issue with the WebBrowser control, lol.

    PS- Yep your post on reddit that was me... sorry I never saw your reply about your confusion on how to use it. Some time ago I ignored my notifications for a while and it built up to the point where I kept ignoring it, so most of the time unless I remember to revisit a post I don't know about replies
    Ah, Thank You so much for elaborating on the process of implementing this. With it worded and structured like that, I reckon I have a good chance at getting it sorted!

    Have a great weekend.

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2024
    Posts
    6

    Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted

    Almost there!

    I have installed the plug-in and got a gif to display in a userform through it, however it isn't animated:

    https://www.youtube.com/watch?v=AEMu40WumZk

  7. #7
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,363

    Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted

    "InkPicture" is not my control and does not support animation.

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2024
    Posts
    6

    Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted

    Quote Originally Posted by fafalone View Post
    "InkPicture" is not my control and does not support animation.
    Ah, picked the wrong one!

    I got it working, Thank You so much for your help

  9. #9
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,363

    Re: [RESOLVED] Excel VBA Userform Gif Problem - Dropdowns Corrupted

    No problem, glad it worked out.

    I'll add the info to the GitHub Readme in case others have the same question... Hadn't occurred to me that those who only use VBA probably aren't familiar with making ActiveX controls, and of course twinBASIC is still new and in beta. Used to be for 64bit Office you needed .NET, a whole different language, to make new controls, and that's been the default for a decade now, so quick custom things like this became rare as VB6 and 32bit faded away.

  10. #10

    Thread Starter
    New Member
    Join Date
    Aug 2024
    Posts
    6

    Re: [RESOLVED] Excel VBA Userform Gif Problem - Dropdowns Corrupted

    Quote Originally Posted by fafalone View Post
    No problem, glad it worked out.

    I'll add the info to the GitHub Readme in case others have the same question... Hadn't occurred to me that those who only use VBA probably aren't familiar with making ActiveX controls, and of course twinBASIC is still new and in beta. Used to be for 64bit Office you needed .NET, a whole different language, to make new controls, and that's been the default for a decade now, so quick custom things like this became rare as VB6 and 32bit faded away.
    Can you sort out a "Buy me a coffee" link in your signature and on your GitHub page?

    I just referred someone else who was having the same problem

Posting Permissions

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



Click Here to Expand Forum to Full Width