You cannot remove a custom user form module using a Microsoft Visual Basic for Applications (VBA) macro in Visio 2003 (830877)
The information in this article applies to:
- Microsoft Office Visio Professional 2003
- Microsoft Office Visio Standard 2003
SYMPTOMSWhen a Microsoft Visual Basic for Applications (VBA) macro
in Microsoft Office Visio 2003 tries to remove a custom user form module that
was created on the fly through code, the user form module is not deleted. To
create the user form, use the various methods that are available to the
following VBA properties:
- VBComponents
- Designer
- CodeModule
CAUSEThis problem occurs when you use the End command to close the custom user form. The End command stops the execution of all code and that will prevent any
bootstrap code to run and to clean up any runtime created modules and
forms.RESOLUTIONTo resolve this problem, use the Unload function with the Me parameter. This will close the user form and allow subsequent
code to run after the form closes. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. The following is an example of how to use the Unload function to close a user form:
Sub CloseButton1_Click()
Unload Me
End Sub
STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
in the "Applies to" section of this article.
Modification Type: | Minor | Last Reviewed: | 1/12/2006 |
---|
Keywords: | kbmacro kbnofix kbprb KB830877 kbAudDeveloper kbAudEndUser |
---|
|