PRB: Inserting a File into a Code Module Changes the Name of the Module (244508)



The information in this article applies to:

  • Microsoft Visual Basic for Applications (VBA) Software Development Kit (SDK) 5.0
  • Microsoft Visual Basic for Applications (VBA) Software Development Kit (SDK) 6.0
  • Microsoft Visual Basic for Applications (VBA) Software Development Kit (SDK) 6.1

This article was previously published under Q244508

SYMPTOMS

Assume that a user has created a new code module in the Visual Basic for Applications (VBA) IDE and names the module something unique. If the user then selects the Insert option from the File menu and inserts a .bas file, the name of the code module changes to the name of the module previously stored in the .bas file.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start the VBE IDE and create a standard module with a few test methods and name it TestModule.
  2. Export TestModule to a .bas file.
  3. Restart the VBA application, create a new CodeModule called MyOwnModule and give it a few test methods.
  4. From the File menu, select Insert, and insert TestModule.bas into the code. Note that the name MyOwnModule changes to TestModule.

Modification Type:MajorLast Reviewed:11/19/1999
Keywords:kbprb KB244508