Notify

Notification Messages with LightBox & Timeout for Excel

Version 1.2
21Mar 2017

Notify Documentation

By: Mark Kubiszyn


Notify for Excel Screenshot



Please Note:
Sales for Notify have been suspended as the Product is undergoing full-blown development and the Software is now in Private Beta Mode - watch this space for future notifications or send me a message to receive an Email when Notify v2 is released


Here is a bespoke HTML/CSS/Javascript notification Message box for Excel to inform users of success/info, errors, warnings and help, featuring a beautiful lightbox overlay for Excel. You can display a Message that has a timeout and will disappear after a specific duration. Notify comes in 4 flavours, success/info, error, warning and help. Notify Messages can be triggered from Buttons or Hyperlinks. Users can click anywhere within the LightBox or on the tiny white cross to close the Message

Notify uses embedded Javasript/HTML/CSS Code by Michael Leigeber, http://www.leigeber.com/ written way back in 2009 - modified for Excel

FEATURES

Works with multiple Monitors
Display 4 different types of Message Dialogs, success/info, error, warning and help
Display a Message for a specific timeout in seconds
Use Mapped Hover Buttons for Yes/No or Okay/Cancel Buttons that users can click
Button Names and Captions can be changed along with the Widths
Add Hyperlinks and HTML Formatting to your Messages
Prevent the user dismissing the Dialog by clicking on the Lightbox
Notify creates a Beautiful, fade-in lightbox effect
Notify uses Embedded Base64 encoded images
The HTML, CSS & Javascript shows you how to:
- prevent F5 and CTRL+F5 from being pressed
- prevent the Right-click context menu from being displayed
- prevent Text Selections for the Body
- remove all scrollbars from a WebBrowser Control

REQUIRED

Windows 7/10, Excel 2007, 2010-2013-2016 (32/64bit)

Available Message Types

There are 4 types of Messages available. Here they are together with their respective images and then more Screen Shots of Version 1.2 with Mapped Hover Buttons:

1. Success - Your request has been processed

1. Success Message

2. Warning - You must enter all required information

2. Warning Message

3. Error - You have encountered a critical error

3. Error Message

4. Help - This is a help message for Notify

4. Help Message

5. Warning Dialog with Mapped Yes/No Buttons

5. Warning Dialog with Mapped Yes/No Buttons

6. Help Dialog with Bespoke Mapped Button

6. Help Dialog with Bespoke Mapped Button

7. Success Dialog with Mapped Yes/No Buttons

7. Success Dialog with Mapped Yes/No Buttons

8. Error Dialog with Bespoke Yes/No Buttons

8. Error Dialog with Mapped Yes/No Buttons

9. Success Dialog with Bespoke OK Button

9. Success Dialog with Bespoke OK Button

Configuring Notify

Configuring Notify is straightforward. First of all you need to copy 2 Userforms into your Workbook - see the section below this one. After you have done this, Notify requires one call at the beginning of your Subroutine to initialise the HTML/CSS/Javascript, default settings in memory and another call to display the Message at another point in your Subroutine. The parameters that must be passed include 'Icon', 'Caption', and 'Message'. There is also an optional 'Timeout' value that can be passed to automatically close the Message after a period of time ie. 2 seconds. Here is the Code to Initialise and Display a Success Message that the user can close:

 
 ' // Success Notification 
 Sub ExampleSuccess()

     ' // initialise
     Notify.Initialise

     ' // do stuff...

     ' // raise a notification
     Notify.DisplayMessage Icon:=Success, Caption:="Success", Message:="Your request has been processed"

 End Sub
 
Here is the Code to Initialise and Display a Success Message that automatically closes after 2 seconds - notice the comma and 2 value added to the end of the call:
 
 ' // Success Notification
 Sub ExampleSuccess()

     ' // initialise
     Notify.Initialise

     ' // do stuff...

     ' // raise a notification
     Notify.DisplayMessage Icon:=Success, Caption:="Success", Message:="Your request has been processed", 2

 End Sub
 
And here is an image of the Success Message:

Notify Success Message

Copying the Code into Your Own Projects

To use Notify in your own Projects, you can simply start a Project from scratch using the Notify Workbook (you can remove the 'License' Worksheet) or you can Export the 2 UserForm .BAS Files from the Notify Workbook and then Import them back into your own Project

Developer Tweaks

I have included a few settings that can be tweaked by developers. You can find these at the top of both UserForm Code Modules. You can tweak the Light Box Darkness, the Light Box Timer Speed and the Light Box Transparency Step. For example if you would like a slightly darker LightBox then you would adjust the following setting in the Notify UserForm Code Module from '60' to '80':

 
 ' // configurable vars for developers 
 ' - use this to deepen the LightBox Colour effect
 '   default 0:=Lightest, 100:=Darkest
 Private Const intLightBoxDarkness As Integer = 80
 
When using the setting above you can also adjust the speed of the LightBox by tweaking the following setting from '8' to '14'. Now the darker LightBox will also fade in at the same rate or slightly faster:
 
 ' - increase this if using a darker LightBoxOpacity to speed up the LightBox Fade
 '   ie. LightBoxOpacity = 80, intLightBoxTransparencyStep = 14
 Private Const intLightBoxTransparencyStep As Integer = 14
 
If you prefer an even faster, smoother fade speed, you can also tweak the LightBox Timer Speed from '0.02' to '0.01':
 
 ' // configurable vars for developers
 ' - you can adjust this but ideally only between 0.01 -> 0.03
 '   use the Transparency Step below when using a darker LightBox
 Private Const dblLightBoxTimerSpeed As Double = '0.01'
 

CHANGELOG

17.03.2017 - (Version 1.2) Added mapped hover buttons in colour sets that match the respective 'success', 'warning', 'criticalerror' and 'help' Dialogs. Button Names and Captions can be changed. The Height, Line Height and Width of the Buttons can be adjusted. Notify can now prevent a dismiss when a user clicks on the Lightbox and hide the Close Cross. I have changed the NotificationType 'Error' to 'CriticalError' as I noticed that I was using a reserved word

07.03.2017 - (Version 1.1) amend to the exit when a user presses on the Lightbox to exit a Notify Message

16.10.2016 - (Version 1) released