-
Aug 23rd, 2024, 08:36 AM
#1
Thread Starter
New Member
[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
-
Aug 29th, 2024, 03:37 AM
#2
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
-
Aug 30th, 2024, 02:21 AM
#3
Thread Starter
New Member
Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted
Originally Posted by fafalone
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.
-
Aug 30th, 2024, 09:01 AM
#4
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
-
Aug 30th, 2024, 11:20 AM
#5
Thread Starter
New Member
Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted
Originally Posted by fafalone
? 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.
-
Aug 31st, 2024, 04:18 AM
#6
Thread Starter
New Member
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
-
Aug 31st, 2024, 06:39 PM
#7
Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted
"InkPicture" is not my control and does not support animation.
-
Sep 2nd, 2024, 02:11 PM
#8
Thread Starter
New Member
Re: Excel VBA Userform Gif Problem - Dropdowns Corrupted
Originally Posted by fafalone
"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
-
Sep 2nd, 2024, 07:00 PM
#9
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.
-
Oct 10th, 2024, 08:42 AM
#10
Thread Starter
New Member
Re: [RESOLVED] Excel VBA Userform Gif Problem - Dropdowns Corrupted
Originally Posted by fafalone
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|