14 Replies Latest reply on Feb 20, 2017 2:10 AM by Ivana Kolin

    Macro: Property Manager - Run-time error '91'

    Juan Cardona

      Hello,

       

      Somebody know about this error in the code? I don't know what to do.

       

      Error.JPG

      Solidworks 2013 SP5.

       

      Thanks

        • Re: Macro: Property Manager - Run-time error '91'
          Deepak Gupta

          Make sure your macro references are correct as suggested here (don't worry on the fact that video is for fixing missing library error but check the process to update your macro library): Fix-Update SOLIDWORKS Macro References

          • Re: Macro: Property Manager - Run-time error '91'
            Ivana Kolin

            Object variable not set (Error 91)

             

            swModel is nothing.

             

            you have posted too little code, therefore I can't see why. Anyway, it is not easy to answer questions with screen dumped code. Nobody feels like typing code.

            • Re: Macro: Property Manager - Run-time error '91'
              Peter Brinkhuis

              As said above, you should probably at least have the following lines preceding the line that you showed:

               

              Dim swApp As SldWorks.SldWorks

              Dim swModel As SldWorks.ModelDoc2

              Set swApp = Application.SldWorks

              Set swModel = swApp.ActiveDoc

               

              Please show us some more of your code so we can actually help you.

                • Re: Macro: Property Manager - Run-time error '91'
                  Juan Cardona

                  Hi Peter, see the code below. Also, you can see below in Bold and italic the problem that I showed in the picture above.

                   

                  With this information is good to fix it?

                   

                  Thanks

                   

                  ' variables

                  Dim swApp          As SldWorks.SldWorks

                  Dim swModel        As SldWorks.ModelDoc2

                  Dim swConfigMgr    As SldWorks.ConfigurationManager

                  Dim swConfig       As SldWorks.Configuration

                  Dim swCustPropMgr  As SldWorks.CustomPropertyManager

                  Dim swRootComp     As SldWorks.Component2

                   

                  Dim retVal         As Long

                   

                  Dim swCustomInfo   As String

                  Dim swDwgno        As String

                  Dim swModelName    As String

                  Dim ValOut         As String

                  Dim ResolvedValOut As String

                   

                  Dim loaded         As Boolean

                   

                  Private Sub btnCancel_Click()

                   

                      Unload Me

                     

                  End Sub

                   

                  Private Sub btnHelp_Click()

                   

                      ' Show the help form

                      frmSWPropertiesHelp.Show

                     

                  End Sub

                   

                  Private Sub btnUpdate_Click()

                   

                  'initialize variables

                      Set swApp = Application.SldWorks

                      Set swModel = swApp.ActiveDoc

                      Set swConfigMgr = swModel.ConfigurationManager

                      Set swConfig = swConfigMgr.ActiveConfiguration

                      Set swCustPropMgr = swConfig.CustomPropertyManager

                   

                   

                   

                     

                     

                  '    common properties tab

                  '    tabMain.Value = 0

                   

                  '       Remove Old Unused Properties

                  '       =======================

                          swModel.DeleteCustomInfo2 swCustomInfo, "First Used"

                          swModel.DeleteCustomInfo2 swCustomInfo, "SheetSize"

                          swModel.DeleteCustomInfo2 swCustomInfo, "CheckedDate"

                          swModel.DeleteCustomInfo2 swCustomInfo, "CheckedBy"

                          swModel.DeleteCustomInfo2 swCustomInfo, "Checked By"

                          swModel.DeleteCustomInfo2 swCustomInfo, "Recorded Date"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400 Description"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400Description"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400 Desc1"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400 Desc2"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400 Desc3"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400 Desc4"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400ExtendedDescription"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400 Extended Description"

                          swModel.DeleteCustomInfo2 swCustomInfo, "AS400ExtendedDesc"

                          swModel.DeleteCustomInfo2 swCustomInfo, "Author"

                          swModel.DeleteCustomInfo2 swCustomInfo, "Material"

                          swModel.DeleteCustomInfo2 swCustomInfo, "Weight"

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write AS400 Description

                  '       =======================

                          retVal = swCustPropMgr.Delete("AS400Description")

                          retVal = swCustPropMgr.Add2("AS400Description", swcustominfotext, txtAS400Description.Value)

                         

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "AS400Description"), "Part Name", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "AS400Description"

                  '            swModel.AddCustomInfo3 swCustomInfo, "AS400Description", swcustominfotext, txtAS400Description.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "AS400Description"), "", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "AS400Description"

                  '            swModel.AddCustomInfo3 swCustomInfo, "AS400Description", swcustominfotext, txtAS400Description.Value

                          End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write AS400 Extended Description

                  '       ================================

                          retVal = swCustPropMgr.Delete("AS400ExtendedDesc")

                          retVal = swCustPropMgr.Add2("AS400ExtendedDesc", swcustominfotext, txtAS400ExtendedDesc.Value)

                   

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "AS400extendedDesc"), "AS400 Desc1 to Desc4", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "AS400ExtendedDesc"

                  '            swModel.AddCustomInfo3 swCustomInfo, "AS400ExtendedDesc", swcustominfotext, txtAS400ExtendedDesc.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "AS400extendedDesc"), "", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "AS400ExtendedDesc"

                  '            swModel.AddCustomInfo3 swCustomInfo, "AS400ExtendedDesc", swcustominfotext, txtAS400ExtendedDesc.Value

                          End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write Description

                  '       =================

                   

                          If (StrComp(txtDescription.Value, "", vbTextCompare) = 0) Then

                              txtDescription.Value = txtAS400Description.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "Description"), "", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "Description"

                              swModel.AddCustomInfo3 swCustomInfo, "Description", swcustominfotext, txtDescription.Value

                          End If

                          retVal = swCustPropMgr.Delete("description")

                          retVal = swCustPropMgr.Add2("Description", swcustominfotext, txtDescription.Value)

                   

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write First used

                  '       ================

                          retVal = swCustPropMgr.Delete("FirstUsed")

                          retVal = swCustPropMgr.Add2("FirstUsed", swcustominfotext, txtFirstUsed.Value)

                   

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "FirstUsed"), "BM999", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "FirstUsed"

                              swModel.AddCustomInfo3 swCustomInfo, "FirstUsed", swcustominfotext, txtFirstUsed.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "FirstUsed"), "", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "FirstUsed"

                              swModel.AddCustomInfo3 swCustomInfo, "FirstUsed", swcustominfotext, txtFirstUsed.Value

                          End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write Reference

                  '       ===============

                          retVal = swCustPropMgr.Delete("Reference")

                          retVal = swCustPropMgr.Add2("Reference", swcustominfotext, txtReference.Value)

                   

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "Reference"), "999999", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "Reference"

                  '            swModel.AddCustomInfo3 swCustomInfo, "Reference", swcustominfotext, txtReference.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "Reference"), "", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "Reference"

                  '            swModel.AddCustomInfo3 swCustomInfo, "Reference", swcustominfotext, txtReference.Value

                          End If

                  '

                  '       -----------------------------------------------------------------------------------------

                         

                  '       Write Drawn By

                  '       ==============

                          If (StrComp(txtDrawnBy.Value, "Please Update", vbTextCompare) = 0) Then

                              txtDrawnBy.Value = ""

                          End If

                         

                          retVal = swCustPropMgr.Delete("DrawnBy")

                          retVal = swCustPropMgr.Add2("DrawnBy", swcustominfotext, txtDrawnBy.Value)

                   

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "DrawnBy"), "Your Name", vbTextCompare) = 0) Then

                             swModel.DeleteCustomInfo2 swCustomInfo, "DrawnBy"

                             swModel.AddCustomInfo3 swCustomInfo, "DrawnBy", swcustominfotext, txtDrawnBy.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "DrawnBy"), "", vbTextCompare) = 0) Then

                             swModel.DeleteCustomInfo2 swCustomInfo, "DrawnBy"

                             swModel.AddCustomInfo3 swCustomInfo, "DrawnBy", swcustominfotext, txtDrawnBy.Value

                          End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write Drawn Date

                  '       ================

                          If (StrComp(txtDrawnDate.Value, "Please Update", vbTextCompare) = 0) Then

                              txtDrawnDate.Value = ""

                          End If

                         

                          retVal = swCustPropMgr.Delete("DrawnDate")

                          retVal = swCustPropMgr.Add2("DrawnDate", swcustominfotext, txtDrawnDate.Value)

                   

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "DrawnDate"), "mm/dd/yy", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "DrawnDate"

                              swModel.AddCustomInfo3 swCustomInfo, "DrawnDate", swcustominfotext, txtDrawnDate.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "DrawnDate"), "", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "DrawnDate"

                              swModel.AddCustomInfo3 swCustomInfo, "DrawnDate", swcustominfotext, txtDrawnDate.Value

                          End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write Checked By

                  '       ================

                          retVal = swCustPropMgr.Delete("CheckedBy")

                          retVal = swCustPropMgr.Add2("CheckedBy", swcustominfotext, txtCheckedBy.Value)

                   

                  '        If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "CheckedBy"), "Chkr Name", vbTextCompare) = 0) Then

                  '            swModel.DeleteCustomInfo2 swCustomInfo, "CheckedBy"

                  '            swModel.AddCustomInfo3 swCustomInfo, "CheckedBy", swcustominfotext, txtCheckedBy.Value

                  '        End If

                  '        If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "CheckedBy"), "", vbTextCompare) = 0) Then

                  '            swModel.DeleteCustomInfo2 swCustomInfo, "CheckedBy"

                  '            swModel.AddCustomInfo3 swCustomInfo, "CheckedBy", swcustominfotext, txtCheckedBy.Value

                  '        End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write Checked Date

                  '       ==================

                          retVal = swCustPropMgr.Delete("CheckedDate")

                          retVal = swCustPropMgr.Add2("CheckedDate", swcustominfotext, txtCheckedDate.Value)

                  '

                  '        If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "CheckedDate"), "mm/dd/yy", vbTextCompare) = 0) Then

                  '            swModel.DeleteCustomInfo2 swCustomInfo, "CheckedDate"

                  '            swModel.AddCustomInfo3 swCustomInfo, "CheckedDate", swcustominfotext, txtCheckedDate.Value

                  '        End If

                  '        If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "CheckedDate"), "", vbTextCompare) = 0) Then

                  '            swModel.DeleteCustomInfo2 swCustomInfo, "CheckedDate"

                  '            swModel.AddCustomInfo3 swCustomInfo, "CheckedDate", swcustominfotext, txtCheckedDate.Value

                  '        End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write Where Used

                  '       ================

                          retVal = swCustPropMgr.Delete("Purpose")

                          retVal = swCustPropMgr.Add2("Purpose", swcustominfotext, txtWhereUsed.Value)

                   

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "Purpose"), "FOR 999 EXTRUDER", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "Purpose"

                              swModel.AddCustomInfo3 swCustomInfo, "Purpose", swcustominfotext, txtWhereUsed.Value

                          End If

                          If (StrComp(swModel.GetCustomInfoValue(swCustomInfo, "Purpose"), "", vbTextCompare) = 0) Then

                              swModel.DeleteCustomInfo2 swCustomInfo, "Purpose"

                              swModel.AddCustomInfo3 swCustomInfo, "Purpose", swcustominfotext, txtWhereUsed.Value

                          End If

                  '

                  '       -----------------------------------------------------------------------------------------

                  '       Write Material

                  '       ===============

                  '       swModel.MaterialName swCustomInfo, "StockShape"

                  '       swModel.addmaterialname swCustomInfo, "StockShape", swcustominfotext, selStockShape.Value

                  '       swModel.AddCustomInfo

                  '       swModel.MaterialUserName = cbxMaterial.Value

                         

                      ' save the information

                      swModel.Save

                     

                      Unload Me

                         

                  End Sub

                   

                   

                   

                  Private Sub UserForm_Activate()

                   

                      Dim datVal As String

                      Set swApp = Application.SldWorks

                      Set swModel = swApp.ActiveDoc

                         

                      ' make sure this is a part (.sldprt) file

                      If (StrComp(UCase(Right(swModel.GetPathName, 3)), "DRW", vbTextCompare) = 0) Then

                          MsgBox "Run this macro in the 3D Part or Assembly", vbCritical, "Save File"

                          Unload Me

                          Exit Sub

                      End If

                   

                   

                      Set swConfigMgr = swModel.ConfigurationManager

                      Set swConfig = swConfigMgr.ActiveConfiguration

                      Set swCustPropMgr = swConfig.CustomPropertyManager

                   

                     

                      loaded = False

                     

                      ' initialize objects

                      Set swApp = CreateObject("SldWorks.Application")

                      Set swModel = swApp.ActiveDoc

                      cbxMaterial.Visible = False

                      lblMaterial.Visible = False

                     

                          ' make sure that if this is a new part, that the file has been saved first

                     Do While swModel.GetPathName = ""

                          MsgBox "This model has not been saved yet", vbCritical, "Save File"

                          swModel.Save

                      Loop

                      ' If this file is a part, activate material selection

                    '  If (StrComp(UCase(Right(swModel.GetPathName, 3)), "prt", vbTextCompare) = 0) Then

                    '      cbxMaterial.Visible = True

                    '      lblMaterial.Visible = True

                    '  End If

                     

                      ' Fill in the Material Property

                   

                    '  If cbxMaterial.Visible = True Then

                    '      cbxMaterial.SetFocus

                    '      cbxMaterial.Value = swModel.MaterialIdName

                    '      'swModel.GetCustomInfoValue(swCustomInfo, "Material")

                    '

                    ''      If (StrComp(cbxMaterial.Value, "SteelAISI1020", vbTextCompare) = 0) Then

                    '      On Error GoTo IgnoreFile

                    '      Open "L:\sw-templates\solidworksdata\Material.dat" For Input As #1

                    '      Do While Not EOF(1)

                    '          Line Input #1, datVal

                    '          cbxMaterial.AddItem datVal

                    '      Loop

                    '      Close #1

                    '      cbxMaterial.Value = Split(swModel.MaterialIdName, "|", 3)(1)

                          'End If

                    '  End If

                   

                   

                      ' initialize the properties tab

                      tabMain.Value = 1

                         

                          ' Fill in the Drawn By Property

                          txtDrawnBy.SetFocus

                          swCustPropMgr.Get2 "DrawnBy", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtDrawnBy.Value = swModel.GetCustomInfoValue(swCustomInfo, "DrawnBy")

                          Else

                              txtDrawnBy.Value = ResolvedValOut

                          End If

                          If (StrComp(txtDrawnBy.Value, "Your Name", vbTextCompare) = 0) Then

                              On Error GoTo IgnoreFile

                              Open "c:\pdm data\drawnby.dat" For Input As #1

                              Line Input #1, datVal

                              txtDrawnBy.Value = datVal

                              Close #1

                          End If

                          If (StrComp(txtDrawnBy.Value, "", vbTextCompare) = 0) Then

                              txtDrawnBy.Value = "Please Update"

                          End If

                          If (StrComp(txtDrawnBy.Value, " ", vbTextCompare) = 0) Then

                              On Error GoTo IgnoreFile

                              Open "c:\pdm data\drawnby.dat" For Input As #1

                              Line Input #1, datVal

                              txtDrawnBy.Value = datVal

                              Close #1

                          End If

                         

                                

                          ' Fill in the Drawn Date

                  IgnoreFile:

                          On Error GoTo 0

                          txtDrawnDate.SetFocus

                          swCustPropMgr.Get2 "DrawnDate", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtDrawnDate.Value = swModel.GetCustomInfoValue(swCustomInfo, "DrawnDate")

                          Else

                              txtDrawnDate.Value = ResolvedValOut

                          End If

                  '        txtDrawnDate.Value = swModel.GetCustomInfoValue(swSumInfoCreateDate, "DrawnDate")

                          If txtDrawnDate.Value <> "mm/dd/yy" Then

                              txtDrawnDate.Value = swModel.GetCustomInfoValue("", "DrawnDate")

                          End If

                         

                          If (StrComp(txtDrawnDate.Value, "mm/dd/yy", vbTextCompare) = 0) Then

                              txtDrawnDate.Value = Date

                          End If

                          If (StrComp(txtDrawnDate.Value, "", vbTextCompare) = 0) Then

                              txtDrawnDate.Value = "Please Update"

                          End If

                         

                          ' Get the CheckedBy

                          txtCheckedBy.SetFocus

                          swCustPropMgr.Get2 "CheckedBy", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtCheckedBy.Value = ResolvedValOut

                  '            txtCheckedBy.Value = swModel.GetCustomInfoValue(swCustomInfo, "CheckedBy")

                          Else

                              txtCheckedBy.Value = ResolvedValOut

                          End If

                  '       txtCheckedBy.Value = swModel.GetCustomInfoValue(swCustomInfo, "CheckedBy")

                  '       If txtCheckedBy.Value = "" Then

                  '           txtCheckedBy.Value = swModel.GetCustomInfoValue("", "CheckedBy")

                  '       End If

                         

                          ' Get the Checked Date Field

                          txtCheckedDate.SetFocus

                          swCustPropMgr.Get2 "CheckedDate", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtCheckedDate.Value = ResolvedValOut

                  '            txtCheckedDate.Value = swModel.GetCustomInfoValue(swCustomInfo, "CheckedDate")

                          Else

                              txtCheckedDate.Value = ResolvedValOut

                          End If

                  '        txtCheckedDate.Value = swModel.GetCustomInfoValue(swCustomInfo, "CheckedDate")

                  '        If txtCheckedDate.Value = "mm/dd/yy" Then

                  '            txtCheckedDate.Value = swModel.GetCustomInfoValue("", "CheckedDate")

                  '        End If

                         

                         

                          ' Get the First Used

                          txtFirstUsed.SetFocus

                          swCustPropMgr.Get2 "FirstUsed", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtFirstUsed.Value = swModel.GetCustomInfoValue(swCustomInfo, "FirstUsed")

                          Else

                              txtFirstUsed.Value = ResolvedValOut

                          End If

                  '        txtFirstUsed.Value = swModel.GetCustomInfoValue(swCustomInfo, "FirstUsed")

                  '        If txtFirstUsed.Value = "" Then

                  '            txtFirstUsed.Value = swModel.GetCustomInfoValue("", "FirstUsed")

                  '        End If

                         

                          

                          ' Get the Where Used

                          txtWhereUsed.SetFocus

                          swCustPropMgr.Get2 "Purpose", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtWhereUsed.Value = swModel.GetCustomInfoValue(swCustomInfo, "Purpose")

                          Else

                              txtWhereUsed.Value = ResolvedValOut

                          End If

                   

                  '        txtWhereUsed.Value = swModel.GetCustomInfoValue(swCustomInfo, "Purpose")

                  '        If txtWhereUsed.Value = "" Then

                  '            txtWhereUsed.Value = swModel.GetCustomInfoValue("", "Purpose")

                  '        End If

                     

                         

                          ' Get the AS400 Extended Description

                          txtAS400ExtendedDesc.SetFocus

                          swCustPropMgr.Get2 "AS400ExtendedDesc", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtAS400ExtendedDesc.Value = swModel.GetCustomInfoValue(swCustomInfo, "AS400ExtendedDesc")

                          Else

                              txtAS400ExtendedDesc.Value = ResolvedValOut

                          End If

                  '        txtAS400ExtendedDesc.Value = swModel.GetCustomInfoValue(swCustomInfo, "AS400ExtendedDesc")

                  '        If txtAS400ExtendedDesc.Value = "" Then

                  '            txtAS400ExtendedDesc.Value = swModel.GetCustomInfoValue("", "AS400ExtendedDesc")

                  '        End If

                         

                         ' Open "c:\documents and settings\nicholas\my documents\sw macros\txtAS400Extra.dat" For Input As #1

                         ' Do While Not EOF(1)

                         '     Line Input #1, datVal

                         '     txtAS400Extra.AddItem datVal

                         ' Loop

                         ' Close #1

                         

                      ' switch to the common properties tab

                  '   tabMain.Value = 0

                     

                           ' Get the Reference Drawing

                          txtReference.SetFocus

                          swCustPropMgr.Get2 "Reference", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtReference.Value = swModel.GetCustomInfoValue(swCustomInfo, "Reference")

                          Else

                              txtReference.Value = ResolvedValOut

                          End If

                     '     txtReference.Value = swModel.GetCustomInfoValue(swCustomInfo, "Reference")

                     '     If txtReference.Value = "" Then

                     '         txtReference.Value = swModel.GetCustomInfoValue("", "Reference")

                     '     End If

                         

                          ' Get the description

                          txtDescription.SetFocus

                          swCustPropMgr.Get2 "Description", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtDescription.Value = swModel.GetCustomInfoValue(swCustomInfo, "Description")

                          Else

                              txtDescription.Value = ResolvedValOut

                          End If

                  '        txtDescription.Value = swModel.GetCustomInfoValue(swCustomInfo, "Description")

                  '        If txtDescription.Value = "" Then

                  '            txtDescription.Value = swModel.GetCustomInfoValue("", "Description")

                  '        End If

                         

                        

                         ' Get the AS400 Description

                          txtAS400Description.SetFocus

                          swCustPropMgr.Get2 "AS400Description", ValOut, ResolvedValOut

                          If (StrComp(ResolvedValOut, "", vbTextCompare) = 0) Then

                              txtAS400Description.Value = swModel.GetCustomInfoValue(swCustomInfo, "AS400Description")

                          Else

                              txtAS400Description.Value = ResolvedValOut

                          End If

                        

                       '           txtAS400Description.Value = ResolvedValOut

                      '    txtAS400Description.Value = swModel.GetCustomInfoValue(swCustomInfo, "AS400Description")

                      '    If txtAS400Description.Value = "" Then

                      '        txtAS400Description.Value = swModel.GetCustomInfoValue("", "AS400Description")

                      '    End If

                         

                         

                     

                  End Sub

                • Re: Macro: Property Manager - Run-time error '91'
                  Alessio Chieffalo

                  I have the same problem when I need to execute a macro of a SKF CAD model, how it's possible to fix this problem?error.png