IN THE SPOTLIGHT: MDE to MDB Conversion Service
(also supports: ACCDE to ACCDB, ADE to ADP, etc)
IN THE SPOTLIGHT: vbWatchdog
VBA error handling just got easier...
" vbWatchdog is off the chart. It solves a long standing problem of how to consolidate error handling into one global location and avoid repetitious code within applications. "
- Joe Anderson,
Microsoft Access MVP
Meet Shady, the vbWatchdog mascot watching over your VBA code →
(courtesy of Crystal Long, Microsoft Access MVP)
IN THE SPOTLIGHT: vbMAPI
An Outlook / MAPI code library for VBA, .NET and C# projects
Get emails out to your customers reliably, and without hassle, every single time.
Use vbMAPI alongside Microsoft Outlook to add professional emailing capabilities to your projects.
In place of the old VBE error dialog, we have provided a new-look Vista-style error dialog that uses the new features of our Global Error Handler. It also happens to be very customizable! (discussed below).
To show the Vista dialog, call it from your global error handler like this:
Public Sub MyGlobalErrorHandler() ErrEx.State = ErrEx.ShowErrorDialog() End Sub
The Vista-style dialog is also fully backwards compatible with non-Vista operating systems.
To customize the Vista-style dialog, use the ErrEx.DialogOptions object included in the SimplyVBA Global error handler library.
This picture highlights the majority of customizable properties exposed by ErrEx.DialogOptions:
ButtonsAsCommandLinks (Boolean), which defines whether or not the dialog uses the buttons arranged horizontally (as above), or buttons arranged vertically (like hyperlinks). Default value is False (as above).
TruncateLinesAtCount (Long) - defines the cut off point (count of characters) at which long lines are truncated (with elipses '...' appended).
Our Vista-style dialog accepts two types of buttons: standard and custom. Standard buttons should be used for the normal features of your error dialog (such as offering 'close', 'debug', 'ignore & continue' buttons). Custom buttons should be used for expanding the functionality further - e.g. by offering a 'search internet for this error' button or a 'send the error log to administrator' button.
To start with, you need to clear the default buttons using ErrEx.DialogOptions.RemoveAllButtons, then you need to add your buttons.
For standard buttons use ErrEx.DialogOptions.AddButton("Button Name", BUTTONACTION). BUTTONACTION can be any one of the following constants:
If you need to add a custom button, you do this with ErrEx.DialogOptions.AddCustomButton("Button Name", "CallbackProcedureName"). CallbackProcedureName is the name of a public procedure that you have defined. It can be declared with a simple subroutine like this:
Public Sub CallbackProcedureName() ' Do something End Sub
The above method is used when you don't want the error dialog to close but just want to do something when the user clicks the button - e.g. you might want to open an internet search window that looks for details on the error number that occurred. If you want the error dialog to close once you've done something, then you declare the procedure slightly differently:
Public Function CallbackProcedureName() As OnErrorStatus ' Do something here... e.g. send an e-mail to the developer / administrator ' The return value of this function will be passed on as the return value to ErrEx.ShowErrorDialog CallbackProcedureName = OnErrorEnd End Function
For an example of using the callback method, see the Sample.mdb included with the installation.
With ErrEx.DialogOptions .WindowTitleText = ApplicationName & " - runtime error" .WindowFooterText = "powered by the SimplyVBA Global Error Handler" .CallStackVisible = True ' Remove any default buttons from the Vista dialog .RemoveAllButtons ' Add a custom callback button which is used to search the internet for further info .AddCustomButton "Search internet", "OnSearchInternet" ' Now add our standard buttons .AddButton "Show Variables", BUTTONACTION_SHOWVARIABLES .AddButton "Debug sourcecode", BUTTONACTION_ONERRORDEBUG .AddButton "Ignore and continue", BUTTONACTION_ONERRORRESUMENEXT .AddButton "Help", BUTTONACTION_SHOWHELP .AddButton "Close", BUTTONACTION_ONERROREND ' We want "Close" to be our default button. (zero based index from left to right) .DefaultButtonNumber = 5 End With
The variables dump window is the window that appears after pressing the 'Show Variables' button on the Vista style error dialog:
To customize this window, you currently have two self explanatory properties:
ErrEx.DialogOptions.VariablesDumpCloseButtonText (string, button caption)
ErrEx.DialogOptions.VariablesDumpWindowTitle (string, window caption)