I am simply trying to replace components in an assembly using the following code: Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long Dim Annotation As Object Dim Gtol As Object Dim DatumTag As Object Dim FeatureData As Object Dim Feature As Object Dim Component As Object Sub main() Set swApp = Application.SldWorks Set Part = swApp.OpenDoc4("C:\Program Files\SolidWorks\data\Templates\DMAssembly.sldasm", 2, 0, "", longstatus) Set Part = swApp.ActivateDoc("DMAssembly") Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc boolstatus = Part.Extension.SelectByID("DM1-1@DMAssembly", "COMPONENT", 0, 0, 0, False, 0, Nothing) Part.ClearSelection Part.ClearSelection boolstatus = Part.Extension.SelectByID("DM1-1@DMAssembly", "COMPONENT", 0, 0, 0, False, 0, Nothing) Part.ClearSelection Part.ReplaceComponents "C:\Program Files\SolidWorks\data\Templates\DM4.sldprt", "", False, 0, True End Sub I got this by recording a macro and I am getting an error saying "Wrong number of arguments or invalid property assigment." I dont understand why I am getting this error since I recorded the macro from SolidWorks. Thanks in advance for any help.