Deactivate Macro Doesn't Run When You Open HTML Document (180699)
The information in this article applies to:
- Microsoft Excel 97 for Windows
- Microsoft Excel 98 Macintosh Edition
This article was previously published under Q180699 SYMPTOMS
When you open a workbook, a macro that is designed to run when you
deactivate the active worksheet does not run.
CAUSE
This problem occurs when the following conditions are true:
- An OnSheetDeactivate macro is assigned to the active worksheet
or workbook, or a macro is attached to the Deactivate event of
the active worksheet.
-and-
- You open a Hypertext Markup Language (HTML) document in Microsoft Excel.
When you open an HTML document, OnSheetDeactivate and Deactivate macros
that are assigned to the active worksheet do not run. However, after you
open the HTML document, the OnSheetDeactivate and Deactivate macros work
correctly.
NOTE: This problem does not occur when a macro is attached to the
Deactivate event of the active workbook.
WORKAROUND
To work around this problem, follow these steps:
- Click the worksheet that was active when you opened the .htm
document.
- Switch to the HTML document.
The OnSheetDeactivate or Deactivate macro runs correctly.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kbbug KB180699 |
---|
|