AnsweredAssumed Answered

Customized Macro Button Run Time Error

Question asked by Chad Hawkenson on Jun 30, 2017
Latest reply on Jul 5, 2017 by Chad Hawkenson

I am wondering if anyone can help me. I have a macro that works great when running with the "play" macro button. I created a customized macro button for ease for other users and now have a run time error. (I highlighted in red below)

 

Sub CalcFaceProperties()

 

 

    Dim vEdges As Variant

    Dim vCurveParams As Variant

    Dim dTotalPerimeter As Double

    Dim lOuterLoop As Long

    Dim dArea As Double

    Dim xLoop As Long

    Dim lLoopCount As Long

    Dim xEdge As Long

    'Dim dMassMeter As Double

    'Dim dAnodisingPerimeter As Double

    'Dim dExtrusionFactor As Double

   

    'get active document

   Set swDoc = swApp.ActiveDoc

   

    'check for active document

    If swDoc Is Nothing Then

   

        MsgBox "No active part document.     ", vbCritical + vbOKOnly, "Face Properties"

        Exit Sub

       

    ElseIf swDoc.GetType <> swDocPART Then

   

        MsgBox "Active document not a part.     ", vbCritical + vbOKOnly, "Face Properties"

        Exit Sub

 

Would be great if I could get this to work properly. Any help is greatly appreciated.

Outcomes