In this post:

An alternative to the VBA.MsgBox. Amongst others with the advantage of an almost unlimited message size.

Preface

The VBA.MsgBox is fine for ad-hoc messages but one has to live with its limits when it comes to the desire of better designed messages since formatting and message size is very very limited. Time and motivation resulted in an alternative without all the limits. The Common VBA Message Service README public GitHub repo provides all information on how to install and use it.

Features

  • 4 message sections, each with an optional label, both free in color, font (proportional or mono-spaced), font size, bold, italic, underline, etc.
  • Width and height adjusted up to a specifiable maximum (within a min/max range)
  • Minimum width specifiable
  • Up to 7 x 7 reply buttons with any caption text plus all the VBA.MsgBox button values
  • Vertical and horizontal scroll-bars when maximum width/height is exceeded (proportional message sections adapt, mono-spaced sections determine their width by the longest line)
  • An optional mode-less display allows the use of any number of message displays in parallel (i.e. instances of the message UserForm).

Examples

The following display examples show the great flexibility of the Common VBA Message Services

Display of an Error Message


Note: The path-to-the-error is a service provided by the Common VBA Error Services! The example is shown because the error service uses the message service the error message display.

Display of an Execution trace

Display of a Process monitor

Display of several Process monitoring instances

Mode-less displayed Buttons with an Application.Run service

Displaying a message mode-less is rather useless when the buttons do not call services via Application.Run. The Common VBA Message Service offers a service to provide displayed buttons with Application.Run information executed when clicked - provided the message is displayed mode-less. This service substantially extends a displayed messages functionality. It may be used to trigger actions/services provided by any open Workbook, i.e. not only the Workbook which displayed the message. 1

Comments

Comments of any kind are more than welcome. I apologize for the fact that it requires a GitHup account/login but this is appropriate for keeping away spammers.

  1. A CommandButton on a Worksheet can only be assigned a macro without arguments! In contrast, Buttons displayed by the Common VBA Message Services may be provided with any number of arguments.