' False question = MessageBox.Show("Do you want to run the Configurator?", "Powell - Switchgear & Instrumentation Ltd.",MessageBoxButtons.YesNo,MessageBoxIcon.Question) ThisApplication.SilentOperation = False 'set condition based on answer If question = vbNo Exit Sub End If GoExcel.Open("C:\Users\wayne.helley\Documents\iLogic\Assembly\Configurator", "Sheet1") Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition ' Create a new matrix object. It will be initialized to an identity matrix. Dim oMatrix As Matrix oMatrix = ThisApplication.TransientGeometry.CreateMatrix 'Get the frame filename from spreadsheet framefile=GoExcel.CellValue("A2") 'Check to see if frame exists If Dir(framefile) = "" Then MessageBox.Show(framefile & vbNewLine & "File Not found." & vbNewLine & "Get the componet from Vault then select 'OK'.", "Powell - Switchgear & Instrumentation Ltd.", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) End If ' Place the frame. Dim frame As ComponentOccurrence frame = oAsmCompDef.Occurrences.Add(framefile​, oMatrix) 'Get parts list from spreadsheet Dim PartList As New ArrayList Dim row As Integer For row = 3 To 1000 'Exits the FOR function when reaching the end of the list If (GoExcel.CellValue("A" & row) = "") Then Exit For End If PartList.add(GoExcel.CellValue("A"& row)) Next 'Place Each part With automatic iMates Dim oString as Object i = 0 Dim oOccEnumerator As ComponentOccurrencesEnumerator For Each oString in PartList 'Check To see If Component exists If Dir(PartList.Item(i)) = "" Then MessageBox.Show(PartList.Item(i) & vbNewLine & "File Not found." & vbNewLine & "Get the componet from Vault then select 'OK'.", "Powell - Switchgear & Instrumentation Ltd.", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) End If oOccEnumerator = oAsmCompDef.Occurrences.AddUsingiMates(PartList.Item(i), False) i=i+1 Next