Can't Step Through Excel 4.0 Macro If Dialog Box Visible (106005)



The information in this article applies to:

  • Microsoft Excel for Windows 95 7.0a
  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 5.0c
  • Microsoft Excel for Windows 5.0
  • Microsoft Excel for the Macintosh 5.0a
  • Microsoft Excel for the Macintosh 5.0

This article was previously published under Q106005

SYMPTOMS

In Microsoft Excel versions 5.0 and 7.0, it is not possible to step through a Microsoft Excel 4.0 macro while a custom dialog box is displayed on the screen.

STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft Excel listed at the beginning of this article. This problem was corrected in Microsoft Excel 97 for Windows and Microsoft Excel 98 Macintosh Edition.

MORE INFORMATION

In Microsoft Excel versions 5.0 and 7.0, when you step through a Microsoft Excel 4.0 macro, one of the following situations may occur:

  • When a custom dialog box is displayed by the SHOW.DIALOG() command, Microsoft Excel exits step mode and closes the Single Step window before showing the dialog box. -or-

  • If a custom dialog box is visible on the screen, if you run the Microsoft Excel 4.0 macro STEP() macro command, you will receive an error message and the macro will halt. -or-

  • If a Microsoft Excel 4.0 macro command fails while a custom dialog box is showing, the Step button in the Single Step dialog box will be unavailable (dimmed). -or-

  • If the dialog box was displayed by a SHOW.DIALOG() command while in step mode, Microsoft Excel will return to step mode when the dialog box is finally dismissed.
Because it is not possible to step through a Microsoft Excel 4.0 macro while a custom dialog box is showing on the screen, you will need to debug the macro before you run the actual dialog box. To debug a Microsoft Excel 4.0 macro that is called from an item in a custom dialog box, follow these steps:

  1. Select the item in the dialog sheet.
  2. On the Tools menu, click Macro.

    Microsoft Excel will display the Macro dialog box and will insert the reference of the item's macro into the Macro Name/Reference box.
  3. In the Macro dialog box, click Step.

REFERENCES

"Visual Basic User's Guide", version 5.0, pages 234-239

Modification Type:MinorLast Reviewed:10/10/2006
Keywords:kbbug kbfix kbprb kbProgramming KB106005