Macros not running in SWX 2010

I have numerous macros written as far back as 2002, they have been working until the install of 2010.

Any help would be appreciated.

This is what I get with the following example

Option Explicit
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim blnInWireframe As Boolean
Dim blnInHLR As Boolean
Dim longstatus As Long, longwarnings As Long
Dim lngChange As Long

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

blnInWireframe = swApp.GetUserPreferenceToggle(swEdgesHiddenEdgeSelectionInWireframe)
blnInHLR = swApp.GetUserPreferenceToggle(swEdgesHiddenEdgeSelectionInHLR)

If blnInWireframe And blnInHLR Then
    lngChange = swApp.SendMsgToUser2("Set to 3D mode?", swMbQuestion, swMbYesNo)
    If lngChange = swMbHitYes Then
        swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInWireframe, False
        swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInHLR, False
    Else
        Exit Sub
    End If
Else
    If Not blnInWireframe And Not blnInHLR Then 'Not blnInWireframe And Not blnInHLR
        lngChange = swApp.SendMsgToUser2("Set to Drawing mode?", swMbQuestion, swMbYesNo)
        If lngChange = swMbHitYes Then
            swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInWireframe, True
            swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInHLR, True
        Else
            Exit Sub
        End If
    Else
        lngChange = swApp.SendMsgToUser2("Allow selection in wireframe and HLV modes is set to " & blnInWireframe _
        & Chr(10) & "and Allow selection in HLR and shaded modes is set to " & blnInHLR & Chr(10) & _
        " Select Yes to set to Drawing mode, No to set to 3D mode" & Chr(10) & "Cancel to Abort", swMbQuestion, swMbYesNoCancel)
        Select Case lngChange
            Case swMbHitYes
                swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInWireframe, True
                swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInHLR, True
            Case swMbHitNo
                swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInWireframe, False
                swApp.SetUserPreferenceToggle swEdgesHiddenEdgeSelectionInHLR, False
            Case swMbHitCancel
           
        End Select
    End If
End If

End Sub

SolidworksApi macros