AnsweredAssumed Answered

hello, i started a macro, i paused not to do unitile actions and when i restart my maco i get run time error '13' Mismatch type. how to fix it? I'll copy my macro to you. Thank you

Question asked by ISMAEL DIAKITE on Mar 11, 2020
Latest reply on Mar 12, 2020 by Fifi Riri

Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

' Hole Wizard
Dim swHoleFeature As Feature
Set swHoleFeature = Part.FeatureManager.HoleWizard5(6, 0, 0, "#00", 1, 0.001397, 0.01, -1, 0.003175, 0.0007112, 0, 1, 0, 0.004445, 1.5707963267949, 0, 0, 0, 0, 0, True, "", False, True, True, True, True, False)
Dim swSketchFeature As Feature
Set swSketchFeature = swHoleFeature.GetFirstSubFeature
swSketchFeature.Select2 False, 0
Part.EditSketch
Dim swSelectionManager As SelectionMgr
Set swSelectionManager = Part.SelectionManager
Dim swSketch As Sketch
Set swSketch = swSketchFeature.GetSpecificFeature2()
Dim swSketchPointArray As Variant
swSketchPointArray = swSketch.GetSketchPoints2()
Dim swMaxPointNumber As Long
swMaxPointNumber = UBound(swSketchPointArray)
Dim swSketchPoint As Object
Dim swCurrentPointNumber As Long
For swCurrentPointNumber = 0 To swMaxPointNumber Step 1
Set swSketchPoint = swSketchPointArray(swCurrentPointNumber)
boolstatus = swSelectionManager.AddSelectionListObject(swSketchPoint, Nothing)
Part.EditDelete
Next swCurrentPointNumber
Dim skPoint As Object
Set skPoint = Part.SketchManager.CreatePoint(-6.46436573939582E-02, 0.034565614425901, 0)
Part.SketchManager.InsertSketch True
End SubERROR

Outcomes