write assembly iprops to excel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello, looking for some help please.
I have an assembly that a rule is ran from and I would like it to export a custom iproperty from all the assembly children to a spreadsheet.
the rule should look through the spreadsheet and try to match the filename with the entries in column 'A'. if it finds a match with one of the assembly children it would write the value from a custom iproperty to column 'N'
if it doesn't find the part number in the spreadsheet then it should create a new line and export the part number to column 'A' and the custom iproperty to column'N'
The rule should cycle through all assembly children until the end, completing the spreadsheet as above..
I have the code shown below that does the assembly file but would appreciate any help /guidance to get the code to iterate through the component occurences...
thanks
'Open file from disk and fill with iProperties GoExcel.Open(ExcelFile2) oDocNumber = ThisDoc.FileName(False) 'without extension 'Define the first row with data RowStart = 2 'Define the amount of skipped rows RowEnd = 1000 'Find the first empty cell For countA = RowStart To (RowEnd * 0.01) + RowStart 'If it's not blank jump to cell + 100. E.g. search cell A2 and then A102 etc. If Not String.IsNullOrEmpty(GoExcel.CellValue("A" & RowEnd)) Then 'Add another 100 to searched cells RowEnd = RowEnd + 1000 Else 'Else if it's empty exit loop Exit For End If Next 'Search for the file name in column A For oRow = RowStart To RowEnd If (GoExcel.CellValue("A" & oRow)) = oDocNumber Then
GoExcel.CellValue("N" & oRow) = iProperties.Value ("Custom", "Work Pack")
GoExcel.Save GoExcel.Close Else 'else create new row If (GoExcel.CellValue("A" & oRow) = "") Then GoExcel.CellValue("A" & oRow) = oDocNumber
GoExcel.CellValue("N" & oRow) = iProperties.Value ("Custom", "Work Pack") GoExcel.Save GoExcel.Close End If End If Next