<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BOM API - Export application in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5894593#M115318</link>
    <description>&lt;P&gt;BOMView.Export method uses the rows sequence inherited from the Model BOM view.&lt;/P&gt;
&lt;P&gt;It does not depend on the sorting in the Structured BOM view.&lt;/P&gt;
&lt;P&gt;You may verify it using the following test code:&lt;/P&gt;
&lt;PRE&gt;Sub BOM_test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oAsmDoc As AssemblyDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oAsmDoc = ThisApplication.ActiveDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oAsmDef As AssemblyComponentDefinition
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oAsmDef = oAsmDoc.ComponentDefinition
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOM As BOM
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oBOM = oAsmDef.BOM
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOM.StructuredViewEnabled = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOM.StructuredViewFirstLevelOnly = False
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOMView As BOMView
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oBOMView = oBOM.BOMViews.Item("Structured")&amp;nbsp; 'Structured
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOMRow As BOMRow
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oProp As Inventor.Property
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDoc As Inventor.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pn As String
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oBOMRow In oBOMView.BOMRows
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oDoc = oBOMRow.ComponentDefinitions.Item(1).Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oProp = oDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;pn = oProp.value
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print oBOMRow.ItemNumber, oBOMRow.ItemQuantity, pn
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;   Call oBOMView.Export("c:\temp\AAA.xls", FileFormatEnum.kMicrosoftExcelFormat)
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; oAsmDoc.Update
&amp;nbsp;&amp;nbsp;&amp;nbsp; Beep
End Sub&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;You may consider several workarounds.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1) you may sort rows in the resulting Excel file&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) you may export BOMRow objects to the Excel file one-by-one in any desired order.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sometimes it is very convenient to organize references to BOM rows in the temporary sorted .NET collection (e.g., SortedList) that allows you to implement any sorting logic: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/system.collections.sortedlist(v=vs.110).aspx" target="_blank"&gt;https://msdn.microsoft.com/en-us/library/system.collections.sortedlist(v=vs.110).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2015 16:58:15 GMT</pubDate>
    <dc:creator>Vladimir.Ananyev</dc:creator>
    <dc:date>2015-11-05T16:58:15Z</dc:date>
    <item>
      <title>BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5830930#M115305</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a BOM export method that is based on the API sample.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;PRE&gt; ' Set a reference to the assembly document.
    ' This assumes an assembly document is active.
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument

    Dim FirstLevelOnly As Boolean
    If MsgBox("First level only?", vbYesNo) = vbYes Then
        FirstLevelOnly = True
    Else
        FirstLevelOnly = False
    End If
    
    ' Set a reference to the BOM
    Dim oBOM As BOM
    Set oBOM = oDoc.ComponentDefinition.BOM
    
    ' Set whether first level only or all levels.
    If FirstLevelOnly Then
        oBOM.StructuredViewFirstLevelOnly = True
    Else
        oBOM.StructuredViewFirstLevelOnly = False
    End If
    
    ' Make sure that the structured view is enabled.
    oBOM.StructuredViewEnabled = True
    
    'Set a reference to the "Structured" BOMView
    Dim oBOMView As BOMView
    Set oBOMView = oBOM.BOMViews.Item("Structured")
        
    Debug.Print "Item"; Tab(15); "Quantity"; Tab(30); "Part Number"; Tab(70); "Description"
    Debug.Print "----------------------------------------------------------------------------------"

    'Initialize the tab for ItemNumber
    Dim ItemTab As Long
    ItemTab = -3
    Call QueryBOMRowProperties(oBOMView.BOMRows, ItemTab)
End Sub

Private Sub QueryBOMRowProperties(oBOMRows As BOMRowsEnumerator, ItemTab As Long)
    ItemTab = ItemTab + 3
    ' Iterate through the contents of the BOM Rows.
    Dim i As Long
    For i = 1 To oBOMRows.Count
        ' Get the current row.
        Dim oRow As BOMRow
        Set oRow = oBOMRows.Item(i)

        'Set a reference to the primary ComponentDefinition of the row
        Dim oCompDef As ComponentDefinition
        Set oCompDef = oRow.ComponentDefinitions.Item(1)

        Dim oPartNumProperty As Property
        Dim oDescripProperty As Property

        If Typeof oCompDef Is VirtualComponentDefinition Then
            'Get the file property that contains the "Part Number"
            'The file property is obtained from the virtual component definition
            Set oPartNumProperty = oCompDef.PropertySets _
                .Item("Design Tracking Properties").Item("Part Number")

            'Get the file property that contains the "Description"
            Set oDescripProperty = oCompDef.PropertySets _
                .Item("Design Tracking Properties").Item("Description")

            Debug.Print Tab(ItemTab); oRow.ItemNumber; Tab(17); oRow.ItemQuantity; Tab(30); _
                oPartNumProperty.Value; Tab(70); oDescripProperty.Value
        Else
            'Get the file property that contains the "Part Number"
            'The file property is obtained from the parent
            'document of the associated ComponentDefinition.
            Set oPartNumProperty = oCompDef.Document.PropertySets _
                .Item("Design Tracking Properties").Item("Part Number")

            'Get the file property that contains the "Description"
            Set oDescripProperty = oCompDef.Document.PropertySets _
                .Item("Design Tracking Properties").Item("Description")

            Debug.Print Tab(ItemTab); oRow.ItemNumber; Tab(17); oRow.ItemQuantity; Tab(30); _
                oPartNumProperty.Value; Tab(70); oDescripProperty.Value
            
            'Recursively iterate child rows if present.
            If Not oRow.ChildRows Is Nothing Then
                Call QueryBOMRowProperties(oRow.ChildRows, ItemTab)
            End If
        End If
    Next
    ItemTab = ItemTab - 3
End Sub&lt;/PRE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a simple modification in the "debug.print" area way at the end of the code. I added some code to write it into excel cells.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;oWorkSheet.Range("B1").Value = oRow.ItemNumber&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works for these items. But.. at second I attempted to export the description like this:&lt;/P&gt;&lt;PRE&gt;Dim oDescripProperty As [Property]&lt;BR /&gt;&lt;BR /&gt;'Get the file property that contains the "Description"
oDescripProperty = oCompDef.Document.PropertySets_&lt;BR /&gt;                   .Item("Design Tracking Properties").Item("Description")

oWorkSheet.Range("C" &amp;amp; y + i).Value = oDescripProperty&lt;/PRE&gt;&lt;P&gt;This result is NOT good, giving me this error when I run the code:&lt;/P&gt;&lt;PRE&gt;An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Exception from HRESULT: 0x800A03EC&lt;/PRE&gt;&lt;P&gt;What I think is wrong is: the [Property] type cannot be exported into Excel. Seems fair. Then I tried to get it as string but here i'm at a loss. This is waht i tried:&lt;/P&gt;&lt;PRE&gt;oWorkSheet.Range("C" &amp;amp; y + i).Value = oDescripProperty.ToString&lt;/PRE&gt;&lt;P&gt;Result in Excel:&lt;/P&gt;&lt;PRE&gt;System.__ComObject&lt;/PRE&gt;&lt;P&gt;So basicly my question is:&lt;/P&gt;&lt;P&gt;How can i convert my [Property] variable into a string?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reading.&lt;/P&gt;&lt;P&gt;I hope that I can resolve this issue quickly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2015 11:04:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5830930#M115305</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-09-24T11:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5830949#M115306</link>
      <description>&lt;P&gt;And the solution if found.. easy but didn't see it at first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;oWorkSheet.Range("C" &amp;amp; y + i).Value = oDescripProperty.Value&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New question then.&lt;/P&gt;&lt;P&gt;In the API sample they use:&lt;/P&gt;&lt;PRE&gt;oPartNumProperty = oCompDef.Document.PropertySets _
                   .Item("Design Tracking Properties").Item("Part Number")&lt;/PRE&gt;&lt;P&gt;But in the API there is also mentioning for:&lt;/P&gt;&lt;PRE&gt;kPartNumberDesignTrackingProperties&lt;/PRE&gt;&lt;P&gt;How is this used? Can't seem to find a reference in the API&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2015 11:33:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5830949#M115306</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-09-24T11:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5831392#M115307</link>
      <description>&lt;P&gt;Anything that starts with a 'k' is an enumerator, or an identifier. It doesn't hold the iProperty value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, from the code,&lt;/P&gt;&lt;PRE&gt;oPartNumProperty = oCompDef.Document.PropertySets _
                   .Item("Design Tracking Properties").Item("Part Number")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;You could write it as&lt;/P&gt;&lt;PRE&gt;oPartNumProperty = oCompDef.Document.PropertySets _
                   .Item("Design Tracking Properties").&lt;STRONG&gt;ItemByPropID&lt;/STRONG&gt;(kPartNumberDesignTrackingProperties)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know, these should function the same way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BrandonBG&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2015 15:08:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5831392#M115307</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-09-24T15:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5832307#M115308</link>
      <description>&lt;P&gt;Thanks for the reply,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well I think the line you provided fits better in my philosophy of coding, I try to use as less "between the quotes" as possible &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So thank you for clarifying that out for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which leads me to a next question, if you should want to open a file via the BOM how would I best go about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently using this line, this just gets the components full file name and then open it using the value.&lt;/P&gt;&lt;P&gt;Are there other options to do this? (Not that there is anything wrong with this I guess.)&lt;/P&gt;&lt;PRE&gt;oInvApp.Documents.Open(oCompDef.Document.FullDocumentName)&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Sep 2015 07:05:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5832307#M115308</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-09-25T07:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5832813#M115309</link>
      <description>&lt;P&gt;To open the file from the BOM, I think you have to identify the row, then open the referenced file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;oInvApp.Documents.Open(BOM.BOMView.BOMRow.ComponentDefinition.Document)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; Now, that line won't work as written, but that's how it's structured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 13:54:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5832813#M115309</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-09-25T13:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5888370#M115310</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's been a while..&amp;nbsp; had some urgent stuff that had a higher priority than this application..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have got a new issue... When I export my BOM the order is based on the model data, and not on the structured list.&lt;/P&gt;
&lt;P&gt;I'm using a code based on the programming help: "Using the BOM APIs API Sample"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am I doing wrong? Why is this list not sorted as my BOM shows?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source code:&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;Public Sub BOMQuery()
    &lt;SPAN style="color: blue;"&gt;' Set a reference to the assembly document.&lt;/SPAN&gt;
    &lt;SPAN style="color: blue;"&gt;' This assumes an assembly document is active.&lt;/SPAN&gt;
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument

    Dim FirstLevelOnly As Boolean
    If MsgBox("First level only?", vbYesNo) = vbYes Then
        FirstLevelOnly = True
    Else
        FirstLevelOnly = False
    End If
    
    &lt;SPAN style="color: blue;"&gt;' Set a reference to the BOM&lt;/SPAN&gt;
    Dim oBOM As BOM
    Set oBOM = oDoc.ComponentDefinition.BOM
    
    &lt;SPAN style="color: blue;"&gt;' Set whether first level only or all levels.&lt;/SPAN&gt;
    If FirstLevelOnly Then
        oBOM.StructuredViewFirstLevelOnly = True
    Else
        oBOM.StructuredViewFirstLevelOnly = False
    End If
    
    &lt;SPAN style="color: blue;"&gt;' Make sure that the structured view is enabled.&lt;/SPAN&gt;
    oBOM.StructuredViewEnabled = True
    
    &lt;SPAN style="color: blue;"&gt;'Set a reference to the "Structured" BOMView&lt;/SPAN&gt;
    Dim oBOMView As BOMView
    Set oBOMView = oBOM.BOMViews.Item("Structured")
        
    Debug.Print "Item"; Tab(15); "Quantity"; Tab(30); "Part Number"; Tab(70); "Description"
    Debug.Print "----------------------------------------------------------------------------------"

    &lt;SPAN style="color: blue;"&gt;'Initialize the tab for ItemNumber&lt;/SPAN&gt;
    Dim ItemTab As Long
    ItemTab = -3
    Call QueryBOMRowProperties(oBOMView.BOMRows, ItemTab)
End Sub

Private Sub QueryBOMRowProperties(oBOMRows As BOMRowsEnumerator, ItemTab As Long)
    ItemTab = ItemTab + 3
    &lt;SPAN style="color: blue;"&gt;' Iterate through the contents of the BOM Rows.&lt;/SPAN&gt;
    Dim i As Long
    For i = 1 To oBOMRows.Count
        &lt;SPAN style="color: blue;"&gt;' Get the current row.&lt;/SPAN&gt;
        Dim oRow As BOMRow
        Set oRow = oBOMRows.Item(i)

        &lt;SPAN style="color: blue;"&gt;'Set a reference to the primary ComponentDefinition of the row&lt;/SPAN&gt;
        Dim oCompDef As ComponentDefinition
        Set oCompDef = oRow.ComponentDefinitions.Item(1)

        Dim oPartNumProperty As Property
        Dim oDescripProperty As Property

        If Typeof oCompDef Is VirtualComponentDefinition Then
            &lt;SPAN style="color: blue;"&gt;'Get the file property that contains the "Part Number"&lt;/SPAN&gt;
            &lt;SPAN style="color: blue;"&gt;'The file property is obtained from the virtual component definition&lt;/SPAN&gt;
            Set oPartNumProperty = oCompDef.PropertySets _
                .Item("Design Tracking Properties").Item("Part Number")

            &lt;SPAN style="color: blue;"&gt;'Get the file property that contains the "Description"&lt;/SPAN&gt;
            Set oDescripProperty = oCompDef.PropertySets _
                .Item("Design Tracking Properties").Item("Description")

            Debug.Print Tab(ItemTab); oRow.ItemNumber; Tab(17); oRow.ItemQuantity; Tab(30); _
                oPartNumProperty.Value; Tab(70); oDescripProperty.Value
        Else
            &lt;SPAN style="color: blue;"&gt;'Get the file property that contains the "Part Number"&lt;/SPAN&gt;
            &lt;SPAN style="color: blue;"&gt;'The file property is obtained from the parent&lt;/SPAN&gt;
            &lt;SPAN style="color: blue;"&gt;'document of the associated ComponentDefinition.&lt;/SPAN&gt;
            Set oPartNumProperty = oCompDef.Document.PropertySets _
                .Item("Design Tracking Properties").Item("Part Number")

            &lt;SPAN style="color: blue;"&gt;'Get the file property that contains the "Description"&lt;/SPAN&gt;
            Set oDescripProperty = oCompDef.Document.PropertySets _
                .Item("Design Tracking Properties").Item("Description")

            Debug.Print Tab(ItemTab); oRow.ItemNumber; Tab(17); oRow.ItemQuantity; Tab(30); _
                oPartNumProperty.Value; Tab(70); oDescripProperty.Value
            
            &lt;SPAN style="color: blue;"&gt;'Recursively iterate child rows if present.&lt;/SPAN&gt;
            If Not oRow.ChildRows Is Nothing Then
                Call QueryBOMRowProperties(oRow.ChildRows, ItemTab)
            End If
        End If
    Next
    ItemTab = ItemTab - 3
End Sub&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;My code: (the commented text is in dutch appolagies for this.&lt;/P&gt;
&lt;LI-SPOILER&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Button click: BOM Export&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub INV_TOOL_BOM_EXPORT_Click(sender As Object, e As EventArgs) Handles INV_TOOL_BOM_EXPORT.Click&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Kopieren van template .xlsm file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oFileName As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oFileName = INV_TOOL_BOM_FILE_NAME.Text&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' BOM export van hoofdassembly.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''&amp;nbsp; Controleren als het een hoofdassembly file is&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Excel file openen&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oXL As Excel.Application&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oWB As Excel.Workbook&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oWS As Excel.Worksheet&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oXL = CreateObject("Excel.Application")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oXL.Visible = True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWB = oXL.Workbooks.Open("C:\Users\jeee\Desktop\BOM Configurator R2.0.xlsm")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWS = oWB.Sheets("Overview")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oTitleRow As Integer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oTitleRow = 5&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oCurrentRow As Integer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oCurrentRow = oTitleRow + 1&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Cells(Rij, Kolom)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' oWS.Cells(6, 2) = "Test"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call BOM_Query(oXL, oWB, oWS, oCurrentRow)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWB.Save()&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox("Finished")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub BOM_Query(ByVal oXL As Excel.Application, ByVal oWB As Excel.Workbook, ByVal oWS As Excel.Worksheet, ByRef oCurrentRow As Integer)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDoc As AssemblyDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDoc = oInvApp.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' BOM openemen als referentie&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOM As Inventor.BOM&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOM = oDoc.ComponentDefinition.BOM&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' BOM levels instellen op alle niveaus&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOM.StructuredViewFirstLevelOnly = False&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' BOM Structured view activeren ( moest dit niet het geval zijn, maar dit zou normaal niet kunnen)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOM.StructuredViewEnabled = True&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' BOM gestructureerde lijst openemen als referentie&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOMView As Inventor.BOMView&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOMView = oBOM.BOMViews.Item("Structured")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call BOMRow_Query_Properties(oBOMView.BOMRows, oXL, oWB, oWS, oCurrentRow)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub BOMRow_Query_Properties(oBOMRows As Inventor.BOMRowsEnumerator, ByVal oXL As Excel.Application, ByVal oWB As Excel.Workbook, ByVal oWS As Excel.Worksheet, ByRef oCurrentRow As Integer)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Loop door de BOM inhoud&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim i As Long&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Export instellingen&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oFile As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oFile = "C:\Users\jeee\Desktop\BOM Configurator R2.0.xlsm"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 1 To oBOMRows.Count&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Opnemen van de huidige rij als referentie&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oRow As Inventor.BOMRow&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oRow = oBOMRows.Item(i)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Opnemen van het component dat overeenkomt met het item van rij (i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oCompDef As Inventor.ComponentDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oCompDef = oRow.ComponentDefinitions.Item(1)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Properties verklaren&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDescriptionProp As Inventor.Property&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oQTY As Integer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oItemNumber As String&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Controle Virtueel component&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If TypeOf oCompDef Is VirtualComponentDefinition Then&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Item nummer ophalen van virtueel component&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oItemNumber = oRow.ItemNumber&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Description ophalen van virtueel component&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDescriptionProp = oCompDef.Document.PropertySets.Item("Design Tracking Properties").Item("Description")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Aantallen ophalen van virtueel component&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oQTY = oRow.ItemQuantity&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Wegschrijven naar Excel Sheet&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWS.Cells(oCurrentRow, 2) = oItemNumber&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWS.Cells(oCurrentRow, 3) = oDescriptionProp.Value&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWS.Cells(oCurrentRow, 4) = oQTY&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Item nummer ophalen van virtueel component&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oItemNumber = oRow.ItemNumber&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Description ophalen van virtueel component&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDescriptionProp = oCompDef.Document.PropertySets.Item("Design Tracking Properties").Item("Description")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Aantallen ophalen van virtueel component&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oQTY = oRow.ItemQuantity&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Wegschrijven naar Excel Sheet&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWS.Cells(oCurrentRow, 2) = oItemNumber&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWS.Cells(oCurrentRow, 3) = oDescriptionProp.Value&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWS.Cells(oCurrentRow, 4) = oQTY&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oCurrentRow = oCurrentRow + 1&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not oRow.ChildRows Is Nothing Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call BOMRow_Query_Properties(oRow.ChildRows, oXL, oWB, oWS, oCurrentRow)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/LI-SPOILER&gt;
&lt;P&gt;I made a screencast to properly show my problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="iframe-container"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/28bc56cf-3bac-4dc3-96e3-5f1d724e896d" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;" frameborder="0" height="650" width="640"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Nov 2015 13:34:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5888370#M115310</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-11-02T13:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5888643#M115311</link>
      <description>Is the Excel sheet the structured BOM view in the incorrect order? Or is it the wrong BOM view?&lt;BR /&gt;&lt;BR /&gt;Maybe you could resort the BOM view before exporting?&lt;BR /&gt;&lt;BR /&gt;Brandon</description>
      <pubDate>Mon, 02 Nov 2015 15:46:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5888643#M115311</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-11-02T15:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5889814#M115312</link>
      <description>&lt;P&gt;I tried resorting before i export, same result. As i compare the exported order with the diffrent BOMviews, I can say the exported BOMview is not the "structured" but the Model Data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in my code is stated:&lt;/P&gt;&lt;PRE&gt;        Dim oDoc As AssemblyDocument
        oDoc = oInvApp.ActiveDocument

        ' BOM openemen als referentie
        Dim oBOM As Inventor.BOM
        oBOM = oDoc.ComponentDefinition.BOM

        ' BOM levels instellen op alle niveaus
        oBOM.StructuredViewFirstLevelOnly = False

        ' BOM Structured view activeren ( moest dit niet het geval zijn, maar dit zou normaal niet kunnen)
        oBOM.StructuredViewEnabled = True

        ' BOM gestructureerde lijst openemen als referentie
        Dim oBOMView As Inventor.BOMView
        oBOMView = oBOM.BOMViews.Item("Structured")

        Call BOMRow_Query_Properties(oBOMView.BOMRows, oXL, oWB, oWS, oCurrentRow)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So where do I go wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 07:34:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5889814#M115312</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-11-03T07:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5890649#M115313</link>
      <description>This is a guess, but the issue may be inside *Private Sub BOMRow_Query_Properties*. Can you reset the BOMView as "Structured" inside this sub? I think the code is looking at the BOMRows in the Model View by default since the Model View is BOMView 1, and Structured View is BOMView 2. Brandon</description>
      <pubDate>Tue, 03 Nov 2015 16:30:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5890649#M115313</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-11-03T16:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5890774#M115314</link>
      <description>&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/bom-export-error/td-p/5883528" target="_self"&gt;http://forums.autodesk.com/t5/inventor-customization/bom-export-error/td-p/5883528&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 17:29:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5890774#M115314</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-11-03T17:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5891815#M115315</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1198441"&gt;@BrandonBG&lt;/a&gt; wrote:&lt;BR /&gt;This is a guess, but the issue may be inside *Private Sub BOMRow_Query_Properties*. Can you reset the BOMView as "Structured" inside this sub? I think the code is looking at the BOMRows in the Model View by default since the Model View is BOMView 1, and Structured View is BOMView 2. Brandon&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have tried this but the result is the same. The BOMView is passed with the BOMrows? Kinda bummed that this is not working for me right now.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 09:32:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5891815#M115315</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-11-04T09:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5892796#M115316</link>
      <description>&lt;P&gt;I'm still not sure you are specific enough in that sub.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        For i = 1 To oBOMRows.Count

            ' Opnemen van de huidige rij als referentie
            Dim oRow As Inventor.BOMRow
            oRow = oBOMRows.Item(i)&lt;/PRE&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        For i = 1 To oBOM.BOMViews.Item("Structured").BOMRows.Count

            ' Opnemen van de huidige rij als referentie
            Dim oRow As Inventor.BOMRow
            oRow = oBOM.BOMViews.Item("Structured").BOMRows.Item(i)&lt;/PRE&gt;&lt;P&gt;Brandon&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 18:40:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5892796#M115316</guid>
      <dc:creator>BrandonBG</dc:creator>
      <dc:date>2015-11-04T18:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5893632#M115317</link>
      <description>&lt;P&gt;Nope.. Tried it, same result. Thanks for the input &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also retried just using the source code.. same result (maybe I had made some mistake reworking the code)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source code result:&lt;/P&gt;&lt;LI-SPOILER&gt;Item | Quantity | Part Number | Description |&lt;BR /&gt;----------------------------------------------------------------------------------&lt;BR /&gt;1 | 1 | Pipe ø88,9 x 6,3 - lg. 427mm _ WN 1.4306 _ 3.1_ | Pipe ø88,9 x 6,3 - lg. 427mm&lt;BR /&gt;3 | 1 | Elbow 90deg DN80(ø88,9) x 3,2 - acc. DIN 2605 type 3_Steel | Elbow 90deg DN80(ø88,9) x 3,2 - acc. DIN 2605 type 3&lt;BR /&gt;4 | 1 | Pipe ø88,9 x 3,2 - lg. 161mm _ WN 1.4306 _ 3.1_ | Pipe ø88,9 x 3,2 - lg. 161mm&lt;BR /&gt;2 | 1 | Repad ø200 x 12mm (Plate 201 x 200) _ WN 1.4307 _ 3.1_ | Repad ø200 x 12mm (Plate 201 x 200)&lt;BR /&gt;6 | 1 | Hex Head Plug 1/4in - acc. ASME B16.11 - A2 | Hex Head Plug 1/4in - acc. ASME B16.11&lt;BR /&gt;5 | 1 | 61477-01_C-BW-1_Nozzle-006-Testplate | Plate ø110 x 5mm&lt;/LI-SPOILER&gt;&lt;P&gt;Some input from Autodesk would be nice... or am I obligated to do a sorting in EXCEL? Seems to me that would be a LAST LAST resort. I believe it shoud export in the correct order from the structured list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I also done some digging. And found this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the source code is stated&lt;/P&gt;&lt;PRE&gt;        'Set a reference to the "Structured" BOMView
        Dim oBOMView As BOMView
        oBOMView = oBOM.BOMViews.Item("Structured")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i follow the API using the search for "BOMView" I found this in the BOMViews Object.&lt;/P&gt;&lt;LI-SPOILER&gt;BOMViews.Item PropertyParent Object: &lt;A href="https://forums.autodesk.com/t5/forums/replypage/board-id/120/message-id/BOMViews.htm" target="_blank"&gt;BOMViews&lt;/A&gt;&lt;BR /&gt;DescriptionReturns the specified BOMView object from the collection.&lt;BR /&gt;SyntaxBOMViews.&lt;STRONG&gt;Item&lt;/STRONG&gt;( &lt;STRONG&gt;&lt;I&gt;Index&lt;/I&gt;&lt;/STRONG&gt; As Variant ) As &lt;A href="https://forums.autodesk.com/HTML/BOMView.htm" target="_blank"&gt;BOMView&lt;/A&gt;&lt;BR /&gt;Parameters &lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Index&lt;/TD&gt;&lt;TD&gt;Input Variant value that specifies the BOMView to return. This can be either a numeric value indicating the index of the item in the collection or it can be a string indicating the name of a BOMView. If an out of range index or a name of a non-existent BOMView is provided, an error will occur.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I looked into the BOMView object.&lt;/P&gt;&lt;LI-SPOILER&gt;BOMView.ViewType PropertyParent Object: &lt;A href="https://forums.autodesk.com/t5/forums/replypage/board-id/120/message-id/BOMView.htm" target="_blank"&gt;BOMView&lt;/A&gt;&lt;BR /&gt;DescriptionProperty that returns the BOM View type. Possible return values are kModelDataBOMViewType (for the 'raw' view), kStructuredBOMViewType (for the structured view) and kPartsOnlyBOMViewType (for the parts-only view).&lt;BR /&gt;&lt;BR /&gt;SyntaxBOMView.&lt;STRONG&gt;ViewType&lt;/STRONG&gt;() As &lt;A href="https://forums.autodesk.com/HTML/BOMViewTypeEnum.htm" target="_blank"&gt;BOMViewTypeEnum&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;BOMViewTypeEnum Enumerator Description&lt;A href="https://forums.autodesk.com/HTML/BOMViewTypeEnum.htm" target="_blank"&gt;BOM View types.&lt;/A&gt;&lt;BR /&gt;Methods &lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;kModelDataBOMViewType&lt;/TD&gt;&lt;TD&gt;62465&lt;/TD&gt;&lt;TD&gt;The 'raw' view.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;kPartsOnlyBOMViewType&lt;/TD&gt;&lt;TD&gt;62467&lt;/TD&gt;&lt;TD&gt;The parts-only View.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;kStructuredBOMViewType&lt;/TD&gt;&lt;TD&gt;62466&lt;/TD&gt;&lt;TD&gt;The Structured View.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But these are not incorperated into the code. So I tried it my self but clearly I don't know how &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try 1: Why can't you access the BOMView from the BOM?&lt;/P&gt;&lt;PRE&gt;        'Set a reference to the "Structured" BOMView
        Dim oBOMView As BOMView
        oBOMView = oBOM.BOMView.ViewType.kStructuredBOMViewType&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll&lt;BR /&gt;Additional information: Public member 'BOMView' on type 'BOM' not found.&lt;/PRE&gt;&lt;P&gt;Try 2: Kinda obvious error because I found the ViewType under "BOMView" and not "BOMViews"&lt;/P&gt;&lt;PRE&gt;        'Set a reference to the "Structured" BOMView
        Dim oBOMView As BOMView
        oBOMView = oBOM.BOMViews.ViewType.kStructuredBOMViewType

An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll

Additional information: Public member 'ViewType' on type 'BOMViews' not found.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But.. When I debug.print my bomview type it gives me the correct value &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; WHY is this so frustrating?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;kStructuredBOMViewType&lt;/TD&gt;&lt;TD&gt;62466&lt;/TD&gt;&lt;TD&gt;The Structured View.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;62466
Item | Quantity | Part Number | Description | 
----------------------------------------------------------------------------------
1 | 1 | Pipe ø88,9 x 6,3 - lg. 427mm _ WN 1.4306 _ 3.1_ | Pipe ø88,9 x 6,3 - lg. 427mm
3 | 1 | Elbow 90deg DN80(ø88,9) x 3,2 - acc. DIN 2605 type 3_Steel | Elbow 90deg DN80(ø88,9) x 3,2 - acc. DIN 2605 type 3
4 | 1 | Pipe ø88,9 x 3,2 - lg. 161mm _ WN 1.4306 _ 3.1_ | Pipe ø88,9 x 3,2 - lg. 161mm
2 | 1 | Repad ø200 x 12mm (Plate 201 x 200) _ WN 1.4307 _ 3.1_ | Repad ø200 x 12mm (Plate 201 x 200)
6 | 1 | Hex Head Plug 1/4in - acc. ASME B16.11 - A2 | Hex Head Plug 1/4in - acc. ASME B16.11
5 | 1 | 61477-01_C-BW-1_Nozzle-006-Testplate | Plate ø110 x 5mm&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Nov 2015 08:32:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5893632#M115317</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-11-05T08:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5894593#M115318</link>
      <description>&lt;P&gt;BOMView.Export method uses the rows sequence inherited from the Model BOM view.&lt;/P&gt;
&lt;P&gt;It does not depend on the sorting in the Structured BOM view.&lt;/P&gt;
&lt;P&gt;You may verify it using the following test code:&lt;/P&gt;
&lt;PRE&gt;Sub BOM_test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oAsmDoc As AssemblyDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oAsmDoc = ThisApplication.ActiveDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oAsmDef As AssemblyComponentDefinition
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oAsmDef = oAsmDoc.ComponentDefinition
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOM As BOM
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oBOM = oAsmDef.BOM
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOM.StructuredViewEnabled = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; oBOM.StructuredViewFirstLevelOnly = False
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOMView As BOMView
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oBOMView = oBOM.BOMViews.Item("Structured")&amp;nbsp; 'Structured
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oBOMRow As BOMRow
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oProp As Inventor.Property
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oDoc As Inventor.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pn As String
&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oBOMRow In oBOMView.BOMRows
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oDoc = oBOMRow.ComponentDefinitions.Item(1).Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oProp = oDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;pn = oProp.value
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print oBOMRow.ItemNumber, oBOMRow.ItemQuantity, pn
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;   Call oBOMView.Export("c:\temp\AAA.xls", FileFormatEnum.kMicrosoftExcelFormat)
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; oAsmDoc.Update
&amp;nbsp;&amp;nbsp;&amp;nbsp; Beep
End Sub&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;You may consider several workarounds.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1) you may sort rows in the resulting Excel file&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) you may export BOMRow objects to the Excel file one-by-one in any desired order.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sometimes it is very convenient to organize references to BOM rows in the temporary sorted .NET collection (e.g., SortedList) that allows you to implement any sorting logic: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/system.collections.sortedlist(v=vs.110).aspx" target="_blank"&gt;https://msdn.microsoft.com/en-us/library/system.collections.sortedlist(v=vs.110).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 16:58:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5894593#M115318</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2015-11-05T16:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5895756#M115319</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1093302"&gt;@Vladimir.Ananyev﻿&lt;/a&gt; Like in this example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you could create a list like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My list would look like this: (Left column beeing the BOMrow-ID, the right item-ID)&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;   &lt;SPAN&gt;5&lt;/SPAN&gt;
&lt;SPAN&gt;2&lt;/SPAN&gt;   &lt;SPAN&gt;8&lt;/SPAN&gt;
&lt;SPAN&gt;3&lt;/SPAN&gt;   &lt;SPAN&gt;9&lt;/SPAN&gt;
&lt;SPAN&gt;4&lt;/SPAN&gt;   &lt;SPAN&gt;7&lt;/SPAN&gt;
&lt;SPAN&gt;5&lt;/SPAN&gt;   &lt;SPAN&gt;3&lt;/SPAN&gt;
&lt;SPAN&gt;6&lt;/SPAN&gt;   &lt;SPAN&gt;1&lt;/SPAN&gt;
&lt;SPAN&gt;7&lt;/SPAN&gt;   &lt;SPAN&gt;4&lt;/SPAN&gt;
&lt;SPAN&gt;8&lt;/SPAN&gt;   &lt;SPAN&gt;10&lt;/SPAN&gt;
&lt;SPAN&gt;9&lt;/SPAN&gt;   &lt;SPAN&gt;6&lt;/SPAN&gt;
&lt;SPAN&gt;10&lt;/SPAN&gt;  &lt;SPAN&gt;2&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then sort it so it looks like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;6&lt;/SPAN&gt;   &lt;SPAN&gt;1&lt;/SPAN&gt;
&lt;SPAN&gt;10&lt;/SPAN&gt;  &lt;SPAN&gt;2&lt;/SPAN&gt;
&lt;SPAN&gt;5&lt;/SPAN&gt;   &lt;SPAN&gt;3&lt;/SPAN&gt;
&lt;SPAN&gt;7&lt;/SPAN&gt;   &lt;SPAN&gt;4&lt;/SPAN&gt;
&lt;SPAN&gt;1&lt;/SPAN&gt;   &lt;SPAN&gt;5&lt;/SPAN&gt;
&lt;SPAN&gt;9&lt;/SPAN&gt;   &lt;SPAN&gt;6&lt;/SPAN&gt;
&lt;SPAN&gt;4&lt;/SPAN&gt;   &lt;SPAN&gt;7&lt;/SPAN&gt;
&lt;SPAN&gt;2&lt;/SPAN&gt;   &lt;SPAN&gt;8&lt;/SPAN&gt;
&lt;SPAN&gt;3&lt;/SPAN&gt;   &lt;SPAN&gt;9&lt;/SPAN&gt;
&lt;SPAN&gt;8&lt;/SPAN&gt;   &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;So I can loop through the right column, which contains the correct export order, but export the corresponding row? Or did you mean something else?&lt;/P&gt;&lt;P&gt;Could you post a sample code to do this? I don't quite see it in the sample code on the MSDN site.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 08:12:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5895756#M115319</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-11-06T08:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5898717#M115320</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know its not part of the problem but why dont you insert a new row in excel for every row of the BOM you add. you wouldnt need to format the grid then as the design format of the excel sheet would follow the inserted rows down.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;StartRow = 1 'or whatever row your first bom line is&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Rows(StartRow + 1 &amp;amp; ":" &amp;amp; StartRow + 1).Select&lt;BR /&gt;Selection.Insert Shift:=xlDown&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cheers&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Nov 2015 07:04:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5898717#M115320</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2015-11-09T07:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: BOM API - Export application</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5898896#M115321</link>
      <description>&lt;P&gt;I'm currently not so worried about how I export the content from the BOM to Excel. There are alot of options that could be used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main concern is that the exported order is not correct. After I can be 100% sure the order for my export is correct I will go to the next step, but I will keep your comment in mind.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 10:26:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/bom-api-export-application/m-p/5898896#M115321</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2015-11-09T10:26:32Z</dc:date>
    </item>
  </channel>
</rss>

