Traverse assembly problem (Referenced config not same as config name)

I have a problem when traversing an assembly, the configuration name differs between using the Comp.ReferencedConfiguration and Config.Name methods

I have simplified the code but it shows the problme I am having. Sample assembly attached too which has configurations etc setup.

Macro prints swChildComp.ReferencedConfiguration + " vs. " + swChildConfig.Name into debugger window. I would expect these to be the same but they are not as per the debugger results shown below code. Some are the same some are not.

'**********************************************

Sub main()

    Dim swApp As SldWorks.SldWorks

    Dim swModel As ModelDoc2

    Dim swAssy As AssemblyDoc

   

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    If swModel.GetType = SwConst.swDocASSEMBLY Then

        Set swAssy = swModel ' Top level assembly

        TransverseComponent swApp, swAssy, 1

    End If

End Sub

Sub TransverseComponent(swApp As SldWorks.SldWorks, swAssy As AssemblyDoc, nLevel As Long)

   

    Dim vChildComp As Variant

    Dim i As Long

    Dim Indent As String

    Dim swChildComp As Component2

    Dim swChildModel As ModelDoc2

    Dim swChildConfig As Configuration

    Dim swChildAssy As AssemblyDoc

   

    For i = 1 To nLevel

        Indent = Indent + "  "

    Next i

   

    vChildComp = swAssy.GetComponents(True)

    For i = 0 To UBound(vChildComp)

   

        Set swChildComp = vChildComp(i)

        Set swChildModel = swChildComp.GetModelDoc2

        Set swChildConfig = swChildModel.GetActiveConfiguration

       

        ' Compare assembly reference name to model config name

        Debug.Print Indent + swChildComp.ReferencedConfiguration + " vs. " + swChildConfig.Name

       

        If swChildModel.GetType = swDocASSEMBLY Then

            Set swChildAssy = swChildModel

            TransverseComponent swApp, swChildAssy, nLevel + 1

        End If

       

    Next i

   

End Sub

'**********************************************

DEBUGGER:

  HCC0102-L1090-MS vs. HCC0102-L1090-MS

    HCC0102-1-L1070-MS vs. HCC0102-1-L1070-MS

    HCC0102-2-MS vs. HCC0102-2-MG

    HCC0102-2-MS vs. HCC0102-2-MG

  HCC0118-L1700 vs. HCC0118-L1260

  HCC0119-L1700 vs. HCC0119-L1080

  HCC0301-L1700-MS vs. HCC0301-L1700-MS

    HCC0301-1-L1700-MS vs. HCC0301-1-L1700-MS

    HCC0101-4-L1700-MS vs. HCC0101-4-L2210-MS

  HCC0302-SS vs. HCC0302-MG

  HCC0102-L1090-MS vs. HCC0102-L1090-MS

    HCC0102-1-L1070-MS vs. HCC0102-1-L1070-MS

    HCC0102-2-MS vs. HCC0102-2-MG

    HCC0102-2-MS vs. HCC0102-2-MG

  HCC0301-L1700-MS vs. HCC0301-L1700-MS

    HCC0301-1-L1700-MS vs. HCC0301-1-L1700-MS

    HCC0101-4-L1700-MS vs. HCC0101-4-L2210-MS

  HCC0118-L1700 vs. HCC0118-L1260

  HCC0119-L1700 vs. HCC0119-L1080

  HCC0302-SS vs. HCC0302-MG

'**********************************************

SolidworksApi macros