Option Explicit Sub massp() Dim swApp As SldWorks.SldWorks Dim count As Double Dim Model As String Dim swModelDoc2 As SldWorks.ModelDoc2 Dim Errors As Long, Warnings As Long Dim vntBodies As Variant Dim swMassProperty As SldWorks.MassProperty Dim boolstatus As Boolean Set swApp = CreateObject("SldWorks.Application") swApp.UserControl = True swApp.Visible = True For count = 1 To 10 Model = LCase(Sheet1.Cells(count, 1)) Set swModelDoc2 = swApp.OpenDoc6(Model, 1, 1, "", Errors, Warnings) vntBodies = swModelDoc2.GetBodies2(swSolidBody, True) Set swMassProperty = swModelDoc2.Extension.CreateMassProperty boolstatus = swMassProperty.AddBodies((vntBodies)) Sheet1.Cells(count, 2) = swMassProperty.mass Sheet1.Cells(count, 3) = swMassProperty.Volume Sheet1.Cells(count, 4) = swMassProperty.Density Sheet1.Cells(count, 5) = swMassProperty.SurfaceArea Sheet1.Cells(count, 6) = swMassProperty.CenterOfMass Sheet1.Cells(count, 7) = swMassProperty.PrincipleAxesOfInertia(0) Sheet1.Cells(count, 8) = swMassProperty.PrincipleAxesOfInertia(1) Sheet1.Cells(count, 9) = swMassProperty.PrincipleAxesOfInertia(2) Sheet1.Cells(count, 10) = swMassProperty.PrincipleMomentsOfInertia Sheet1.Cells(count, 11) = swMassProperty.GetMomentOfInertia(0) swApp.CloseDoc (Model) Set swModelDoc2 = Nothing DoEvents Next End Sub