Spinner v1.2 is an awesome VBA project created by Mark Kubiszyn for Excel 2007-2016. It is published under a permissive MIT license. Any preloader from several free stunning sets created by the Pixel Buddha graphics team can be used to display the status of a process during VBA code execution.
For the technical minded, the Spinners are embedded Base64 encoded data displayed in a WebBrowser Control upon a transparent UserForm, so that they appear to be floating on the main Excel Application Window! They are faded in and out when displayed using a VBA call to Javascript Functions written into the HTML Markup.
Base64 encoding is a way of taking binary data (images in this case) and turning it into text (letters, numbers and the symbols "+", "/" and "="). It's a convenient way to store and transmit binary data over media that is specifically used for textual data, like email and HTML forms.
Use these preloaders when you are completing any task in VBA, instead of a progress bar, for a jaw-dropping visual effect!
For the technical minded, the Spinners are embedded Base64 encoded data displayed in a WebBrowser Control upon a transparent UserForm, so that they appear to be floating on the main Excel Application Window! They are faded in and out when displayed using a VBA call to Javascript Functions written into the HTML Markup.
Base64 encoding is a way of taking binary data (images in this case) and turning it into text (letters, numbers and the symbols "+", "/" and "="). It's a convenient way to store and transmit binary data over media that is specifically used for textual data, like email and HTML forms.
Use these preloaders when you are completing any task in VBA, instead of a progress bar, for a jaw-dropping visual effect!
Data Storage In Spinner v1.2
What you can learn by reviewing Mark's well-presented VBA project:
Image data encoded in Base64 format was embedded in the Spinner v1.2 UserForm. While it is quite easy to export and import a single module with hardcoded data to any VBA project, adding data for additional GIFs requires tedious work.
In addition, I noticed that although Mark's Spinner v1.2 contained data for 10 GIFs images (5 different Spinners in two sizes 64x64 pixels and 128x128 pixels), our forked Spinner 2.0 file was slightly smaller in size, despite having 20 animated full size 128x128 GIFs!
To understand why the original file is so bloaded, you need to read about the internal performance cache that VBA maintains and how this redundant information can be cleaned using the VBA Cleaner powered by Ribbon Commander.
- How to remove borders from an Internet Explorer WebBrowser control in a UserForm!
- How to make an Excel UserForm transparent with visible controls!
- How to work with Base64 image data in VBA
Image data encoded in Base64 format was embedded in the Spinner v1.2 UserForm. While it is quite easy to export and import a single module with hardcoded data to any VBA project, adding data for additional GIFs requires tedious work.
In addition, I noticed that although Mark's Spinner v1.2 contained data for 10 GIFs images (5 different Spinners in two sizes 64x64 pixels and 128x128 pixels), our forked Spinner 2.0 file was slightly smaller in size, despite having 20 animated full size 128x128 GIFs!
To understand why the original file is so bloaded, you need to read about the internal performance cache that VBA maintains and how this redundant information can be cleaned using the VBA Cleaner powered by Ribbon Commander.
Data Storage In Spinner v2.0
I love working with Excel Tables or ListOjects as called in the VBA object model. The only problem with storing text in a Table is that the the total number characters that a cell can contain is limited to 32,767. You can read about Excel's specifications and limits here.
So, I wrote a simple procedure to split GIF Base64 encoded data into strings that can fit in cells. Multiple entries are entered in the Table for large images, as shown below. Twenty 128x128 stunning Pixel Buddha GIFs have been encoded in an Excel Table. I believe that it is much easier to add or remove images in a Table than embed data in VBA. There is minimal file size bloat, even if VBA is not cleaned, although VBA cleaning is strongly recommended.
So, I wrote a simple procedure to split GIF Base64 encoded data into strings that can fit in cells. Multiple entries are entered in the Table for large images, as shown below. Twenty 128x128 stunning Pixel Buddha GIFs have been encoded in an Excel Table. I believe that it is much easier to add or remove images in a Table than embed data in VBA. There is minimal file size bloat, even if VBA is not cleaned, although VBA cleaning is strongly recommended.
Additional Features In Spinner v2.0
There is no need to store aninated GIFs in different sizes, as the 128x128 pixel versions can be easily scaled up or down by simply changing width and height parameters inside the LoadBase64Data function. Our forked demo shows Spinners at 192x192 pixels, plus the optional text on a 256x256 WebBrowser control.
Elvis Zem, a Spanish .NET/VBA developer, has contributed two optional features:
Elvis Zem, a Spanish .NET/VBA developer, has contributed two optional features:
- A parameter in the Spinner.FadeIn procedure that can control the text shown under the animated image.
- A progress indicator that can be shown using a call to the Spinner.Indicator function with a value between 0-1.
New Features In Spinner v2.1
Guys that are laughing, crying, cheering and dancing!
Spinner World Cup 2018 Edition
Spinner v2.2 with 11 Top World Cup Goal Scorer Cartoons!
Download Our Forked VBA Project
Add the WOW factor to your VBA projects to impress your colleagues and boss!
Click the download button to get the FREE Spinner progress indicators
Free Pixel Buddha Sets
What Do You Think?
I would love to get your input on how to make this fun Excel project better. If you notice any bugs or have a new feature request or would like to suggest modifications to existing features, please let me know in the comments section below. This article will always be updated with the latest software version, so check this web page often.
I look forward to your feedback :)
I look forward to your feedback :)