You need to be logged in to view this content. Please login or become a member.


  1. CryoDesigner

    Hi Keith,

    I don’t understand why my If/Then doesn’t work when booQuestion is True. I stepped through and booQuestion is True but won’t execute the debug.print statement:

    Dim swApp As SldWorks.SldWorks
    Dim swModel As SldWorks.ModelDoc2
    Dim booQuestion As Boolean

    Sub main()

    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc

    booQuestion = swModel.GetSaveFlag
    If booQuestion = True Then
    Debug.Print “Needs to be saved.”
    End If

    End Sub

    • This line is redundant:

      If booQuestion = True Then

      It is like saying, “If True is True Then do X”. Which should still work, but in this case the program is confused. So simply use this instead:

      If booQuestion Then

Questions and Comments

You must be logged in to post a comment.