Visual Basic Objects

UserForms Versus DialogSheets

In Microsoft Excel 97, DialogSheets have been replaced by UserForms. UserForms are now part of the Visual Basic Editor (VBE) (whereas DialogSheets are part of the workbook), making for a more efficient development environment. DialogSheets will continue to work in Microsoft Excel 97, so there is no reason to immediately convert Microsoft Excel Dialog Sheet to UserForms. Microsoft Excel 97 will also support custom dialogs constructed using the Dialog Editor or the XLM dialog table. You may want to consider converting to UserForms, however, as they are common across all Office products and support the use of custom controls.

Range Method Changes

The Range method has been changed to improve efficiency. Numeric values can now be dimensioned either as integer or double. Note that in Microsoft Excel 95 numeric values resolved into strings where appropriate. This is no longer the case. Therefore, code that concatenates a range containing a number into a text string will generate a "run-time error 13 Type Mismatch" error. To avoid this, you should define a variable as a string and set the value of that string to the value of a cell.

Below is an example where A1 is equal to a number. This code works in Microsoft Excel 95 but will not work in Microsoft Excel 97:

Msgbox "The value of Cell A1 =>" & Range("A1")

To make this work in Microsoft Excel 97:

Dim strCellValue As String
strCellValue = Range("A1")
MsgBox "The value of Cell A1 =>" &  strCellValue