Tips, Notes, and Cautions


This page collects in one place the tips, notes, and cautions referenced elsewhere in this guide.

Tips

Before renaming UserForms, remove previously generated instances

Before renaming a UserForm that you’ve already generated into its targets, use the MDUF ribbon command   to remove the UserForms that have the old name. 

Know how to clear #NAME? errors

If you load an MDUF Project workbook into Excel but you haven’t first enabled the Formmaker add-in, and if you then recalculate one or more FormSpec worksheets that employ MDUF worksheet functions, #NAME? errors will appear. Follow the link above for a procedure for clearing these errors. 

Know how to turn off Excel’s “unlocked formula” indicator

Excel indicates any cells that contain formulas but which are not locked. It does so with a small green triangle inside the cell. It’s nice to be able to remove some visual clutter by suppressing the unlocked-formula indicator. In MDUF, the keyboard shortcut Ctrl+Shift+E toggles the display of the unlocked-formula indicator. 

In back-end code, reference the Pages of a MultiPage by name, not index

When you delete a Page or Pages from a FormSpec worksheet, MDUF re-indexes the remaining Pages to ensure that the set of indices for the Pages of a MultiPage is complete and well ordered. For this reason, when you write code to meet the needs of UserForms containing MultiPages, it’s safest to reference Pages by name. Referencing them by index could potentially create a need to manually edit the code after you alter the Page contents of a MultiPage. 

You might not need to write preview macros from scratch

When you captured UserForms into the CaptureWorkbook, you also captured the back-end code for your UserForms into the CaptureWorkbook. Look in the UserForm Code Block of the FormSpec worksheet. Some pieces of this code might be needed for the preview macro for that UserForm. Instead of writing it from scratch, consider using pieces of what you find in the UserForm Code Block. 

Cautions

Know the limits of the command MDUF>This FormSpec>Delete>Target UserForms…

When you’re doing an update of your UserForms, you can use this MDUF ribbon command to purge a workbook of previously generated UserForms. But be aware that this command deletes only those UserForms that were generated by MDUF. It leaves other UserForms in place. This can be an issue when you’re converting a workbook from legacy UserForms to MDUF UserForms. 

Avoid redefining internal MDUF names

To avoid redefining an internal MDUF name, verify that the name you choose for a range or formula in your project isn’t already in use by MDUF. You can see the MDUF names that aren’t hidden by examining the menu in Excel’s name box. But some MDUF names are hidden. All hidden MDUF names end with “.h” (dot H). If the name you choose isn’t visible already, and doesn’t end in “.h” you should be OK. 

Every control and Page on a given FormSpec worksheet must have a unique name

Every control you define in a given FormSpec worksheet must have a unique name. Upper case and lower case are equivalent. If two controls on the same FormSpec worksheet have identical names, the results are unpredictable and almost certainly unwelcome. Using the control-type prefixes displayed in the section “Naming controls” can help ensure that names don’t conflict. 

Avoid circular references when using relative positions of controls

Adopt conventions that prevent circular references when using relative positioning of controls. For example, position controls relative to those above them on the form, never below. 

Avoid overwriting formulas in TabIndex cells

If you invoke the ribbon command  to assign tab order automatically, MDUF overwrites any formulas in TabIndex cells. 

Avoid multiple spaces and tabs in the names of worksheets

In scripting, the conversion of multiple spaces and tabs to a single space character applies to all parts of all scripting commands, including the argument of the activate command. If you use multiple spaces and tabs in the names of the worksheets of your Project workbooks, trouble will definitely ensue. This practice is not supported. For example, naming a worksheet “qwe     rty” is not supported. Also unsupported: worksheets whose names begin or end with spaces or tabs.