Customize or Translate Content of Run-Time Messages
DoneEx VbaCompiler for Excel allows you to translate or customize content of your run-time messages. It allows you to show messages in your customer’s language or customize your personal message content related to your project.
To do that you just need to create your own ‘Custom Resource Dictionary’. Files with examples of such a dictionary may be found in the ‘rsc’ sub-folder of the VbaCompiler for Excel installation folder.
To create your own run-time resource dictionary, you need to copy one of file examples present in VbaCompiler for Excel installation folder into a location where you are going to work with the dictionary and then name the dictionary file as you wish. Open this copy in Microsoft Notepad and edit the resource values.
The Custom Resource Dictionary is a simple text file encoded in UTF-8 format and represents a dictionary of messages which are used in run time.
The content of the Custom Run-Time Resource Dictionary is implemented as collection of <RESOURCE_NAME>=<RESOURCE_VALUE> statements.
If you want to change a text value of a resource, then you need to rewrite the part to the right of the ‘=’ assignment sign with your own content. The whole text value should be written in a single line without starting a new line. Some of the text resources may be shown in a multiple line message box. To start a new line in the text you need to insert the ‘\n’ symbol combination. While displaying, ‘\n’ will be converted to a new line transfer.
You can only edit the RESOURCE_VALUE part of each resource – that is the part that comes right after the ‘=’ symbol. If you edit the RESOURCE_NAME (the left part from the ‘=’ symbol) the resource dictionary will ignore this resource and VBA Compiler run-time library will use the default content for the message.
Be sure that you are saving your resource dictionary text file with UTF-8 encoding, double checking your “Save As” settings for your Custom Run-Time Resource Dictionary file as shown in the following image:
When you create your own resource dictionary you need to select the file in the ‘Resource Dictionary’ field in the compilation options form, as shown in the following image:
Sometime the run-time messages need information which is available only during run-time. There are Template Tags available in order to display this information.
A template tag is a reserved word written in capital letters and wrapped by the “<?” and “?>” strings.
Template tags can be used in all customized messages and are substituted by the corresponding actual values before the message will be shown.
Please note that not all tags may be available for every message content.
If some tag is not available, then it will not be substituted, and that tag will be shown in the message as is.
<?AUTHOR_CONTACT?> – The content of ‘Author contact’ field from the VbaCompiler compilation option form.
<?COMPID?> – The Computer ID of the computer where the application is started.
<?TRIAL_DAYS_LEFT?> – The Number of days which are left until the end of the trial period.
<?APPNAME?> – The content of the ‘Application Name’ field from the VbaCompiler compilation option form.
<?DATE_FROM?> – The Date of the start of the usage period, fetched from the registration key.
<?DATE_TO?> – The Date of the end of the usage period, which is acquired from the registration key.
<?WBKPATH?> – The Path of the location of the current workbook with the compiled VBA code.
<?RNAME?> – The Name of the registered customer, gathered from the registration key. If the registration key is not present, then the tag will be substituted with the word “UNREGISTERED”.
<?RMAIL?> – The E-mail of the registered customer, which is taken from the registration key. If the registration key is not present, then the tag will be substituted with the word “UNREGISTERED”.