Skip to content

Trying to Import Classes In Use Causes Incremental Naming #25

@M-Scott-Lassiter

Description

@M-Scott-Lassiter

Expected Behavior

When I try to import a class, I expect it to show up with the same name, and subsequent calls will reference the appropriate class, even if I am overwriting a class that was currently in use.

Current Behavior

When I tried to import "fredDeveloper_ModuleManager", it resulted in "fredDeveloper_ModuleManager1" and subsequent scripts thus didn't find the correct reference.

Steps to Reproduce

  1. Run this script
Sub FredSourceControl()
    Dim ModuleManager As New fredDeveloper_ModuleManager
    
    With ModuleManager
        .Directory = ThisWorkbook.Path & "\Source Code"
        .Import "fredDeveloper_ModuleManager"
    End With

End Sub
  1. Subsequent runs will not compile, because it overwrote fredDeveloper_ModuleManager as fredDeveloper_ModuleManager1

Possible Solution

Either prevent this behavior, or find a way to write as a second class, delete the first, and rename the second one.

Environment

Microsoft Office Version: 365
Program: Excel
Operating System: Windows 10
Other Relevant Information: None

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions