Introduction
Introducing Rotor for Excel
Rotor, (or Rotor Preloader) Fading SVG Preloader with Tween Easing for Excel (32bit or 64bit, Version 16, Office 365) · use Rotor for an Iterative Task (looping)
Here is a nice little SVG Preloader for Excel with some Tweening using Easing Functions that can be used with some 'Iterative Task' in Excel. There are four SVG's in two designs, Dotty Disc and Chunky Circle together with 3 easing functions, easeOutQuad, easeInOutExpo and easeInQuintic. You can change the size of the Preloader's width and height and the Colour for the Chunky Circle. I include the Affinity Designer files and the SVG's with the purchase download. You can also choose whether or not to show some of the Excel background through the Preloader (see Rotor9 on the Demo Sheet). You are purchasing Version 1.3
If you love Rotor, you may also like any of the following Software
LightboxIcon · LightboxAnimatedGif
Prerequisites
- Microsoft Excel 2016 Version 16 (32bit or 64bit) · designed for Office 365 Windows 11
- Basic to moderate Excel Skills and some basic VBA skills
- Windows PC · NOT a Mac!
- No support is provided for customization of this Software
Features
- Useful for running 'some' Tasks in Excel when you want to display some kind of Progress Indicator dynamically. Use Rotor for an Iterative Task
- 4 SVG's in 2 designs, Dotty Disc and Chunky Circle
- 3 easing Functions: easeOutQuad, easeInOutExpo and easeInQuintic
- Align the Preloaders within the Active Window for both Horizontal and Vertical absolute positioning wherever you scroll in the Worksheet using msoAlignMiddles, msoAlignCenters, msoAlignTops, msoAlignLefts, msoAlignRights etc. using my SetShapeAlignment() Subroutine. All together there are 9 different options and the msoALignCenters and msoAlignMiddles are interchangeable. I also added code to Force partial Columns and Rows, meaning where someone has adjusted the main Excel Window and it obscures some of a Column or Row then the Code will slightly tweak the view to allow for this and totally beautify the Preloader making a near-perfect fit
- Change the Width and Height of the Preloaders
- Choose to allow the Excel background to show through as the Preloader runs or not (by default SVG Fill is Solid)
- Only one instance of Preloader is allowed to be ran at any time, constrained by a 'Running' Variable
- The Task demonstrated in the Usage Section is also in the purchsed download. It is called 'Task.xlsm'
- Embed Image Subroutine provided as a workaround if you have any issues with Transparency when creating or using your own Images
Credits
Preloaders created in Affinity Designer by Mark Kubiszyn. Download Blue Dotty Disc · Black Dotty Disc · Brown Dotty DiscBackground Vector by Jaka Samudera - purchase Pro license or use with attribution. See the image at www.vecteezy.com
Installation (current version v1.1)
Extract all of the files to your PC/Laptop by choosing 'Extract All ...' after doing a right-click with the Mouse on the 'Rotor.zip' archive. You should see a Folder containing the SVG images called 'Preloaders (SVG)' and two other files, 'Rotor.xlsm' and 'Task.xlsm'. Open the 'Rotor.xlsm' file and click on the Demo Sheet. Go through all of the Preloader demos to see what Rotor is, what it does and the context that it is used in by the Software that you purchsed. Go into the VBE (Visual Basic Editor) and examine the VBA Code
To use Rotor in your own Projects without using your own Task open the 'Rotor.xlsm' file and your own Macro-enabled Project. Then open the VBE (Visual Basic Editor) and drag the 'mdPreloader' Code Module into your own Macro-enabled file. Now add an SVG Image to the Worksheet, using Insert->Pictures->Place over cells->This Device from the 'Illustrations' Group on the 'Insert' Tab of the Ribbon. Name it "disc1" (you can hide it or leave it as-is) and then run the Rotor1() Subroutine to see your Preloader in action. Make sure any Sheet you are adding images to is Unprotected!
Please note: if you have any issues with Transparency whilst using this Fading Preloader then see the Usage Section for a workaround to embed an image from a Website URL or your PC/Laptop into a Shape
To change Rotor to use your own task please read the Usage Section in this online documentation; this is very much advised before you begin to create your own Rotor Preloaders for Excel or before turning to Support. The example used in this Section is included in the compressed archive - its called 'Task.xlsm'
Usage
How to use Rotor
Abstract
Rotor is designed to allow you to integrate an Excel Task with an SVG Image and run an easing animation to let users know that processing is ongoing. Rotor consists of a handful of Shapes containing SVG images and some VBA Code in the 'mdPreloader' Code Module, that's it
Changing the SVG's used by Rotor
Rotor images are designed by myself using Affinity Designer as Vectors on a Grid sized 200 pixels by 200 pixels at 72 DPI and exported out as SVG's. They are then inserted just like any other image via the Ribbon, 'Insert' Tab. Rotor images are all hidden and only made visible when they are required for the animation or for editing. There are 4 Shapes containing the images. Before you view them, Unprotect the Sheet by choosing 'Unprotect Sheet' from the 'Protect' Group of the 'Review' Tab on the Ribbon. Now use the Selection Pane on the 'Find & Select' Button on the 'Editing' Group of the 'Home' Tab on the Ribbon to view each Shape. You can click each Name to hide/unhide the Shape and its image contents. Each image can be changed from the 'Illustrations' Group on the 'Insert' Tab of the Ribbon - see my image below (the current image will show up with transparency due to the Code's fade routine, but will always be slightly visible for you to enable you to select it and change it):
Transparency Issues and a Workaround
Should you have any issues with your images whereby the Transparency does not work as you would expect a workaround is to embed your image into any Shape. So, unprotect the Worksheet and delete one of the Shapes, for example 'disc1'. Now Insert any Shape using Insert->Shapes (select one, ie. a rectangle and draw it on the Worksheet), rename it to 'disc1' and leave it selected. Open the VBE (Visual Basic Editor) and go into the 'mdPreloader' Code Module. Scroll down until you see the 'EmbedImageInShape()' Subroutine as per below:
Private Sub EmbedImageInShape() ' select an image. you can add your own Shape of any design and then run this Macro to embed the image ActiveSheet.Shapes.Range(Array("disc1")).Select ' change the filepath/name to your own image With Selection.ShapeRange.Fill .Visible = msoTrue .UserPicture "https://www.kubiszyn.co.uk/documentation/images/Preloader1.png" .TextureTile = msoFalse .RotateWithObject = msoTrue .Transparency = 0.96 End With End SubChange the UserPicture to an image Filepath/Name on your PC/Laptop and run the Code. Check that the Shape looks sound - remove any outline and then run the example again to see the results
Here is Rotor spinning a completely different image:
The Demo Rotors
The Demo Rotors are linked via Hyperlinks to their respective VBA Code Subroutines ie. Rotor1 Hyperlink will run the Code for the main Rotor1() Subroutine in the 'mdPreloader' Code Module. All of the other are set up in a similar way. An event handler on the Demo1 Sheet will detect your Hyperlink and follow it to the Code Subroutines:
'-¬ Worksheet_FollowHyperlink, all followed hyperlinks will be caught here Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) Dim JumpTo As String JumpTo = Target.Range(1, 1).value Application.Run JumpTo End SubSetting the Excel Window Alignment for the Preloaders
Rotor Preloaders are aligned in the Excel Window using the 'SetShapeAlignment()' Subroutine. Here is the Code:
' setup the Shape alignment and positioning within the Excel Window before it is displayed SetShapeAlignment ShapeToAlign:=Sprite, _ VerticalPosition:=msoAlignCenters, _ HorizontalPosition:=msoAlignRights, _ ShapeWidth:=PreloaderWidth, _ ShapeHeight:=PreloaderHeightTo change the alignment you can swap the VerticalPosition:=msoAlignCenters and the HorizontalPosition:=msoAlignRights parameters. Available Parameters are:
msoAlignCenters msoAlignLefts msoAlignRights msoAlignTops msoAlignBottoms msoAlignMiddlesThe Code used above will force the Preloader to the Right side of the Excel Window for the Horizontal Position like the image below:
Using Rotor in your own Projects
To use Rotor in your Projects can be a little tricky depending on what you want to achieve. You 'MUST' only use Rotor for 'Iterative tasks' where you use loops, so that you can successfully integrate your task with the Rotor VBA. So in the Demos you can see that I run 1 Task, which is to colour some Cells in Excel in shades of brown and green creating a visible flickering as the Fill colour of the Cells is constantly changed. Now to enable us to keep track of the Colour Fill updating I wrap the Task with my Rotor Code and also include an update for the Statusbar as the progress of this Task continues, giving the user an additional indication of the overall status of the Task progress - this is optional, you do not have to do this
In order to align the Preloader for a complete rotation turn of 360, I deploy some nifty timing routines and combine this with the easing functions that give me the degree of rotation to aply as the task continues. Obviously I could keep speeding up the Preloader until the Task completes and you would see it spinning faster than your eye can view it, causing some very strange patterns and flickering - I include a Demo Video of such an effect in the Videos section. However I need to temper the runaway Preloader and reset it for every complete rotation. Code is iin situ to do this, but can take some understanding
Perhaps what is best is to run through a complete example of creating a new Project and then adding a task that loops Cells and creates FOrmula down a Range to show you what I mean. Please follow the steps below for a concise example of usage
Creating a Project and Adding Roto to Run an Iterative (looping) Task in Excel
First of all open a new Excel File and save it as a Macro-enabled Excel file called 'Task.xlsm'. Then open the 'Rotor.xlsm' file. Go into the VBE Editor (F11 or ALT+F11). Drag the 'mdPreloader' Code Module into the 'Task.xlsm' file. Close the 'Rotor.xlsm' file
On 'Sheet1' insert one of my SVG images using 'Pictures->Place over cells->This device' from the 'Illustrations' Group of the 'Insert' Tab on the Ribbon. You can find them in the 'Preloaders (SVG)' Folder which is part of the Rotor.zip, compressed archive. It doesn't matter which one. Use the Selection Pane on the 'Find & Select' Button on the 'Editing' Group of the 'Home' Tab on the Ribbon to view each Shape. Rename the Shape as 'disc1'. So now your 'Task.xlsm' file should look something like this:
You can choose to hide the image by clicking on the tiny 'eye' next to the Shape Name on the Selection Pane, but the Code will do this anyhow. So go back into the VBE and click on the 'mdPreloader' Code Module. Scroll down and find this part in the Code:
' run main animation with Task Do DoEvents ' your task goes here! ' replace this Code with your own, whatever you are normally running. your Code must not change Sheet otherwise the Shape will not be displayed ' standard practice when writing VBA is to Copy Ranges or perform Code without selecting every Sheet ' ## DEMO CODE ONLY ##Now you need to remove and replace the following parts of the existing Code so firstly remove this:
Dim I As Variant Dim iVal As Variant Dim rngCell As Range Application.StatusBar = True '@Ignore ObsoleteWhileWendStatement While I < 250 DoEvents Randomize I = I + 1 iVal = Format$(I / 250, "0%") Application.StatusBar = "Processing a task... " & iVal ' // borrowed from Ejaz Ahmed's Class Progressbar as I liked the technique ' modified to stay within a Blue/Pink spectrum of Colours I like ;) For Each rngCell In ActiveSheet.Range("J7:S7").Cells 'On Error Resume Next rngCell.Interior.Color = RGB(100 * Rnd(I), 58, 21) 'On Error GoTo 0 Next rngCellAnd replace it with this:
Dim i As Long Dim SelectedCell As Range Dim SelectedSheet As Worksheet Set SelectedSheet = ActiveWorkbook.Sheets("Sheet1") For Each SelectedCell In SelectedSheet.Range("A1:A500").Cells i = i + 1 'SelectedCell.Activate SelectedCell.Value = i DoEvents SelectedCell.Offset(0, 1).Value = Int((2 ^ 16 - 2 ^ 1) * Rnd() + 2 ^ 1) DoEventsNow scroll down until you find this:
WendAnd replace it with this:
Next SelectedCellLastly scroll up to the top of the Code Module and comment out the Private Declaration so that you can run the macro via the Worksheet Macros Box:
Option Explicit 'Option Private ModuleThat's it, now click on Sheet1 and press ALT+F* and run the Rotor1() Subroutine and you should see the Preloader Fade in and rotate and then Fade out again. The Formula will be written down the Range. This is the result as the Preloader runs and does its stuff. I chose the Blue Dotty Disc SVG for my Task:
I will include the Task in the purchased download
Screen Shots
A Screenshot of my Carbon Dotty Disc SVG Preloader used by Rotor for Excel
A Screenshot of my Brown Dotty Disc SVG Preloader used by Rotor for Excel
A Screenshot of my Blue Dotty Disc SVG Preloader used by Rotor for Excel
A Screenshot of my Green Chunky Circle SVG Preloader used by Rotor for Excel
A Screenshot of my Carbon Dotty Disc SVG Preloader used by Rotor for Excel, resized on-the-fly for its width and height
A Screenshot of my Carbon Chunky Circle SVG Preloader used by Rotor for Excel
A Screenshot of my Blue Dotty Disc SVG Preloader used by Rotor for Excel where I have specified that I want to allow some of the Excel backgroound to 'show through'
Alignment has been tweaked for Version 1.3 so that you have up to 9 different options even as you scroll around the Worksheet to align your Preloaders
This Preloader has been set to 'msoAlignLefts' and 'msoAlignCenters'
FAQ
Q. Why doesn't the Shape fade completely out?
A. I have left the transparency at 0.96 so that you can see it to select it when using the Selection Pane
Rotor Videos
This is a video of Rotor as it runs a task and displays various SVG Preloaders. The Preloaders run faster than is shown as the Video Recorder appears to slow them down somewhat! Music is 'Bite Me - NEFFEX' (Caution: music contains explicit lyrics - listen at your own risk). View this video on YouTube
This is a video of using Rotor together with a different 'Iterative' (looping) Task than is distributed with Rotor. I start by Saving a new Macro-enabled Excel file and then I insert one of the SVG Preloaders. I then change parts of the VBA Code to integrate a simple task that outputs formula down a Range in a Worksheet. I make a few mistakes, but have left these in as they show you that you can't always get it right first time! The Preloader runs faster than is shown as the Video Recorder appears to slow them down somewhat! Music is 'Bite Me - NEFFEX' (Caution: music contains explicit lyrics - listen at your own risk). View this video on YouTube
This is a video of using Rotor together with a different 'Iterative' (looping) Task than is distributed with Rotor. I start by Saving a new Macro-enabled Excel file and then I insert one of the SVG Preloaders. I then change parts of the VBA Code to integrate a simple task that outputs formula down a Range in a Worksheet. I make a few mistakes, but have left these in as they show you that you can't always get it right first time! The Preloader runs faster than is shown as the Video Recorder appears to slow them down somewhat! Music is 'Bite Me - NEFFEX' (Caution: music contains explicit lyrics - listen at your own risk). View this video on YouTube
This is a video of Rotor as it runs a task displaying a really weird Preloader Animation - something you can get by tweaking the settings of the VBA Code. The Preloader runs faster than is shown as the Video Recorder appears to slow them down somewhat! It also doesn't show the little squares from the Excel Background when viewing in the real world - only in this Video capture. Music is 'No Filter Me - NEFFEX' (Caution: music contains explicit lyrics - listen at your own risk)
Shorts & Reels
Support
Support is 100% optional and I provide it for your convenience, so please be patient, polite and respectful
Support for my Software
- Responding to questions or problems regarding the Software and its features
- Fixing valid (replicated) bugs and reported issues for the VERSION I HAVE WRITTEN
Software support does not include
- Customization and installation services
- Support for third party software or ANY kind of development whatsoever
Before seeking support
- Make sure your question is a valid Software Issue and not a customization request
- Make sure you have read through the FAQ's, online documentation and any related video guides before asking support on how to accomplish a task
- Ensure that you access to the VBOM is allowed and that Macros can run in Excel
- Make sure to provide 'proof of purchase' and state the name / version of the Software that you are having issues with when requesting support by Email or via Facebook
How to get Support
Contact Mark Kubiszyn on the Email address provided when you purchased the Software, including the Order Number
Remember to be patient, if there has been an issue with your download, Mark will always respond within 48 hours and will Email you the File directly if neccessary. For other issues the response time may be considerably longer and I may choose to respond to specific questions only (as is my right), depending on what has been asked
Future Builds
* No ideas as yet!
Bug Fixes
A bug has been identified for Rotor whereby on some machines the Preloader gets a '.Fill.Transparency' of 0, which renders the White hole in the disc solid Black and you just get a Black Circle instead of the actual proper coloured image. Even the Blue Preloader also shows up as solid Black. This is occurring where changing the '.Fill.Transparency' completely destroys the original colours which bizarrely never happens with the machine and Excel version that I am using. I have this as a 'pending' issue to resolve - please watch this space if you have purchased and experience this issue. You can still use the other 2 Preloaders or swap them for your own Preloaders as I attempt to rectify it: Fixed as of 16.12.2023 with a new version 1.2
A bug has been raised that the Preloaders were just 'off-centre'. I have fixed this by removing the hidden Columns in the Worksheet. For some reason this is affecting my Shape alignment routine and will require further investigation: Fixed as of 16.12.2023 with a new version 1.2
A bug exists whereby if you choose not to use the Screen Positioning Code, 'ActiveWindow.ScrollRow = 1' and 'ActiveWindow.ScrollColumn = 1' then the Rotor Preloader will not be centered in the Active Window despite setting the alignment parameters for the Shape. This is down to the Active Window Visible Range which is not specified due to the 'ported' code from one of my other Projects. I will fix this issue but as of now it is 'pending' as the Code works with the Screen Positioning Code in situ: Fixed as of 18.12.2023
Credits
SVG Preloaders
Preloaders created in Affinity Designer by Mark Kubiszyn. Download Blue Dotty Disc · Black Dotty Disc · Brown Dotty DiscSVG Preloaders
Background Vector by Jaka Samudera - purchase Pro license or use with attribution. See the image at www.vecteezy.comChangelog
Read more information on the status of each release below. The latest Version including a description of any changes is shown first
18.12.2023 - (Version 1.3)
Fix to correctly align the Preloaders within the Active Window for both Horizontal and Vertical absolute positioning wherever you scroll in the Worksheet using msoAlignMiddles, msoAlignCenters, msoAlignTops, msoAlignLefts, msoAlignRights etc. using my SetShapeAlignment() Subroutine. All together there are 9 different options and the msoAlignCenters and msoAlignMiddles are interchangeable. Works with or without Headings and allows for the Vertical Scrollbar. I also added code to Force partial Columns and Rows, meaning where someone has adjusted the main Excel Window and it obscures some of a Column or Row then the Code will slightly tweak the view to allow for this and totally beautify the Preloader making a near-perfect fit
This is all good preparation for my next Project 'ShapeX' which will be availabel in the New Year - a concise Shape Collection Animation and Positioning Class for Excel
16.12.2023 - (Version 1.2)
New version for a fix to the Transparency issue. It is now advised to add a Shape and then run a small Macro to embed your image, after which the Transparency will work correctly
Also removed the Hidden Columns as this affected the centering of the Preloaders (something to look at in a future release maybe, but for now I have unhidden the hidden Columns)
8.12.2023 - (Version 1 and version 1.1)
General release of Rotor Preloader (or Rotor Preloader) for Excel and an immediate update in the form of v1.1