Introduction

Introducing CSS Task Dialog for Excel & Access

CSS Task Dialog - use as a Dialog to manage multiple long-running tasks that you may have in Excel with Percentage Indicator, 8 CSS Preloader Cubic-bezier Animation Timing Functions & 3 Optional Messages

This Software allows you to present one of 8 different Preloader animations, together with 3 Messages on a Modeless Dialog with a percentage indicator. You can run the Task Dialog continuously as you iterate through various Tasks to give a seamless effect. You can link your Tasks by adding them as separate Subroutines or Functions or integrate the Task Dialog into your existing ones

Prerequisites

  • Excel & Access 2016 (32bit or 64bit, Version 16.0)
  • Basic to moderate Excel Skills and VBA skills to Copy the ICSSTaskDialog Class and add an example into your own Project. Additional VBA skills maybe required in order to integrate your own specific tasks
  • Windows PC · NOT a Mac!
  • No support is provided for customization of this Software

Features

  • 8 Cubic-bezier Animation Timing Functions
  • 3 Messages that can be used to inform the user of any progress
  • A Percentage Indicator derived from a part of a Task divided by the Total parts of the task
  • Change the Colour of the main Preloader Border
  • An inbuilt Pause member of the ICSSTaskDialog that can be used to pause for a specific duration in milliseconds
  • Excel & Access Examples included in the Zip File

This is a video of some of the CSS Task Dialog Demos

Music Credits
Get Incredible Madness by Frankinstein here https://t.lickd.co/XvGMYYj2Gdr
License ID: xLpvGYB7dDz
Get this and other songs for your next YouTube video at https://lickd.co

Installation

CSSTaskDialog.zip contains all of the Files. Unzip the Archive to your PC (right-click, extract all...). There are 4 Files, the main Sweet CSS Task Dialog.xlsm File, an Access Database example, a Readme.txt File and a License.txt File. Open and read the two text Files. Open the CSS Task Dialog.xlsm File and test out the Demos by clicking on any of the Buttons

Usage

CSS Task Dialog.xlsm


The Demo Workbook and a Deep Dive into the Code
Open 'CSS Task Dialog.xlsm' File. Click on the example Buttons to view the Demos. The first Button demonstrates running some dummy tasks in Excel. First of all I write out Primes to a Worksheet. Then I make some colourful blocks, before clearing up my mess at the end by removig the added Worksheets. The Dialog displays a 'Downhill' Preloader and I update the Messages accordingly as the process continues. The Preloader has beed set to an Excel Green Colour. The second Demo runs through all of the different available Preloaders and demonstrates methods to Colour the Text and add carriage returns (read more below). Going back to the first Demo, to enable the Task Dialog to integrate into my Code I write the tasks as separate Subroutines and then simply call them by passing in a reference to a new instance of the ICSSTaskDialog Class object. All of the Code to do this (apart from the individual Subroutines) for my tasks is shown below - I have left the comments in situ, so that you can see how each new task is called:
 
Dim TaskDialog As ICSSTaskDialog
Set TaskDialog = New ICSSTaskDialog
    
' first Task, initialise the Task Dialog
TaskDialog.BeginTasks False, Downhill, "#217346", "Running Task 1 of 3", "Prime numbers (this message is optional...)", "Writing prime numbers to worksheet, please wait "
' add your first Task, pass in the Class so that we can update it.  when it's finished, pause for a second or two
Task1 TaskDialog
TaskDialog.Pause 2
         
' next Task
TaskDialog.AnotherTask False, Downhill, "#217346", "Running Task 2 of 3", "Wasting time...", "Just wasting some time creating coloured blocks "
' add your next Task, pass in the Class so that we can update it.  when it's finished, pause for a second or two
Task2 TaskDialog
TaskDialog.Pause 2

' next Task
TaskDialog.AnotherTask False, Downhill, "#217346", "Running Task 3 of 3", "Cleaning up!", "Cleaning up the mess I just made ;) "
' add your next Task, pass in the Class so that we can update it.  when it's finished, pause for a second or two
Task3 TaskDialog
TaskDialog.Pause
  
' last Message, but no Task with a slightly longer pause
TaskDialog.AnotherTask False, Downhill, "#217346", "All Tasks Complete", vbNullString, "Finishing up, please wait... "
TaskDialog.Pause 3
   
' kill the process
TaskDialog.Kill

The parts of the ICSSTaskDialog that do all of the work are, .BeginTasks(), .AnotherTask(), .Update() (not actually visible in the Code above) and .Kill(). The first inialises the first task. The second is used to update the Dialog for 'another' or 'each' task. The third is used to provide live interaction between the Dialog and a task. After each call to either .BeginTasks() or .AnotherTask() you will notice that I then pass a reference of the Class into my task Subroutines, Task1, Task2 and Task3. This is required as I need to use the .Update() member of the Class at an appropriate time, to provide live feedback as my task runs

As you can also see from the Code above I have added in a .Pause() member to the ICSSTaskDialog Class so that you can simply use TaskDialog.Pause 2 to pause for 2 seconds if you need to after running any task. If you are going to run long tasks in Excel then I think you should go to the trouble of making everything really smooth and interactive in terms of the information relayed back to the user. To do this, you can use the Pause Member, but you also have 3 Messages that you can use to provide user feedback and the third one can also be used to control a percentage indicator. The Messages that you can use are, Title, Strapline and Message, being the main Title or Header of your Task Dialog, an appropriate Strapline and a more concise, message body. Here is the Code that I use in the second Demo to present the Pendulum Preloader with its 3 Messages - notice the use of <br /> to force two line breaks in the Message text for the main body:
TaskDialog.AnotherTask False, Pendulum, "#C00000", "Preloader Demo", "Swing low...", "This Preloader is called Pendulum<br /><br />Wowsers, it hangs and swings very low ;) "

You can use a span together with the style function to 'Style' your messages further should you wish. Here is the Code that I use to make the Text 'Twitter Blue' in the second Demo - notice the use of the double quotes, you don't need to escape characters like apostrophes (') but you do need to wrap up your quotations as double quotes for anything inside of the Message Text:
TaskDialog.AnotherTask False, FullCircle, "#79A2E3", "Preloader Demo", vbNullString, "This Preloader is called Full Circle<br />- I have styled it in <span style=""color: #79A2E3;"">Twitter Blue</span> "

Okay so you may have noticed other Parameters in the two main .BeginTasks() and .AnotherTask() members of the ICSSTaskDialog Class. These two Subroutines are pretty much the same as one another, the only real difference being the call to the JavaScript Function StartProc() to begin the Task Dialog - I have left them split out as two separate Subroutines though for future development, but they could be pulled together, I will leave that up to you to do if you so wish. The first Parameter is the AppFocus, which simply allows the Code to force the main Excel Window or Worksheet to retain focus as the Code executes, meaning that if you set this to 'True' then you could type directly into the Excel Cell as the process runs without having to select it again. The second Parameter 'Preloader' can be one of 8 different Preloaders ie. Perpetuum, Impetus, FullCircle, Gravity, Overshot, Downhill, Pendulum, WTF which are the Cubic-bezier Animation Timing Functions used for animations. The third Parameter is so that you can change the Colour of the Border of the Preloader which forms the main highlighted part of the spinning animation - this needs to be passed as a String ie. "#789" which is purple

How to use CSS Task Dialog in your own Projects
First you need to Copy in the ICCTaskDialog Class. Open your File and drag the Class into your own Workbook in the VBE Editor - you should see both instances of Excel open, just use the Mouse to pick up the Class and move it across into your Project. Then you will need to (preferably but not definitely) wrap up your task in a Subroutine. For example suppose you had a task that filters a Table by each Row and then copies out the data into separate Excel Files, then you would wrap this up as a Subroutine and after initialising a TaskDialog via the ICSSTaskDialog Class with default Messaging, call it like this:
Dim TaskDialog As ICSSTaskDialog
Set TaskDialog = New ICSSTaskDialog

TaskDialog.BeginTasks False, Downhill, "#879", "Running Task 1 of 1", vbNullString, "Writing files from table rows, please wait "

' call your task like this--v
WriteFilesFromTableRows(TaskDialog)           

Then somewhere in your WriteFilesFromTableRows() Subroutine you would need to include a call to .Update() passing the current position of your task and the total positions of your task to render a percentage value at the end of the main body Message. You can omit the call to .Update() if you don't need this functionality - remember to always add the DoEvents though and you may need to add this in various places to free up processing back to Excel:
' just DoEvents if you don't want to track any percentage values of the task
DoEvents

' DoEvents and a call to .Update() to track percentage values of the task, where Task may be 1, 2, 3 or 10, 20, 30 etc.
DoEvents
TaskDialog.Update Task, 100

CSS Task Dialog Screen Shots

CSS Task Dialog writing Prime numbers to a Worksheet

CSS Task Dialog running a dummy task

CSS Task Dialog 'Downhill' Preloader

CSS Task Dialog 'Pendulum' Preloader

CSS Task Dialog 'Perpetuum' Preloader

Access CSS Task Dialog Preloader Example 1

Access CSS Task Dialog Preloader Example 2

FAQ

There are no Q & A for CSS Task Dialog


Sweet Alerts

This is a video of some of the CSS Task Dialog Demos - Music is optional ;)

Music Credits
Get Incredible Madness by Frankinstein here https://t.lickd.co/XvGMYYj2Gdr
License ID: xLpvGYB7dDz
Get this and other songs for your next YouTube video at https://lickd.co

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

* There are currently no bugs identified

Changelog

You can find the version history in the Code Module for any Macro-enabled Software or read more information on the status of each release
- the latest Version including a description of any changes made is always shown first

20.12.2020 - (Version 1) Released. 06.01.2021 added an Access example of usage for Access version 16.0

General release of CSS Task Dialog