PRB: Password Prompt for VBA Project Appears After Excel Quits (280454)
The information in this article applies to:
- Microsoft Office Excel 2003
- Microsoft Excel 2000
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q280454 SYMPTOMS After running a macro that passes a reference for a
workbook containing a password-protected VBA project to an ActiveX dynamic-link
library (DLL), you are prompted for the VBA project password when Excel quits.
CAUSE This problem occurs if the ActiveX DLL does not properly
release the reference to the workbook that contains the password-protected VBA
project. RESOLUTION To correct this problem, design classes in your ActiveX DLL
so that workbook references are properly released before the classes
terminate.
A common scenario where a class Terminate event does not fire is one where you have a circular reference
between objects. A circular reference would be created if, for example, a
parent object creates a child object and hands that child object a reference to
the parent. If the child's reference to the parent is not released, the parent
object will not terminate.
The steps in the following section
demonstrate how a circular reference between objects might occur and how the
password prompt will appear if the objects hold onto a reference for a
protected workbook when Excel quits. The resolution, which is to call a method
for one of the objects to break the circular references so that the objects can
terminate, is also described below.
Modification Type: | Major | Last Reviewed: | 12/15/2003 |
---|
Keywords: | kbprb KB280454 |
---|
|