This SOLIDWORKS 2024 VBA macro should save the active part as a STEP file, but it never creates the file and shows no error. Find every bug, explain each one in one sentence, then give me the corrected complete macro.

Dim swApp As Object
Dim swModel As Object
Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Dim path As String
    path = Replace(swModel.GetPathName, ".SLDPRT", ".step")
    swModel.Extension.SaveAs path, 0, 1, Nothing, Nothing
End Sub
