<?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: Ilogic code to export BOM to excel file overwrites data in excel file in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056648#M101228</link>
    <description>&lt;P&gt;update:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realized after I posted that maybe you wanted to use an existing file (not template) and just do a save as, if so something like this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM

oBOM.PartsOnlyViewEnabled = True

Dim oBOMView As BOMView
oBOMView = oBOM.BOMViews.Item("Parts Only")

xlApp = CreateObject("Excel.Application")

'comment out or change to false 
'in order to not show Excel
xlApp.Visible = True 
xlWorkbook = xlApp.Workbooks.Open("C:\Temp\Test.xlsx")

xlWorksheet = xlWorkbook.Worksheets.Item("Sheet1")

Dim row As Integer
row = 5

xlWorksheet.Range("B4").Value = "ITEM"
xlWorksheet.Range("C4").Value = "QTY"
xlWorksheet.Range("D4").Value = "DESC"
xlWorksheet.Range("E4").Value = "Part Number"

'Dim bRow As bomRow
bRows = oBOMView.BOMRows
For Each bRow In bRows

	Dim rDoc As Document
	rDoc = bRow.ComponentDefinitions.Item(1).Document
	
	Dim docPropertySet As PropertySet
	docPropertySet = rDoc.PropertySets.Item("Design Tracking Properties")
	
	xlWorksheet.Range("B" &amp;amp; row).Value = bRow.ItemNumber
	xlWorksheet.Range("C" &amp;amp; row).Value = bRow.ItemQuantity
	xlWorksheet.Range("D" &amp;amp; row).Value = docPropertySet.Item("Description").Value
	xlWorksheet.Range("E" &amp;amp; row).Value = docPropertySet.Item("Part Number").Value
	
	row = row + 1
Next

oNow = DateString &amp;amp; "_" &amp;amp; TimeString
oNow = oNow.Replace("/","_")
oNow = oNow.Replace(":","_")
xlWorkBook.SaveAs(Filename:="C:\Temp\SampleNew_" &amp;amp; oNow &amp;amp; ".xlsx")

xlWorkbook.Close (False)
xlApp.Quit&lt;/PRE&gt;</description>
    <pubDate>Tue, 02 May 2017 20:23:49 GMT</pubDate>
    <dc:creator>Curtis_W</dc:creator>
    <dc:date>2017-05-02T20:23:49Z</dc:date>
    <item>
      <title>Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7055782#M101218</link>
      <description>&lt;P&gt;I am trying to create Ilogic code that opens an excel template file (with existing data in multiple tabs), performs a save as (Ilogic handles the naming schema), then exports the structured BOM to an existing tab in the new file. The open and save as perform without issue, but I can't get the BOM to export without one of the following issues occurring.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The BOM is written to the new excel file but all tabs and pre-existing data are lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. When exporting the BOM I am prompted that the file I am writing to is read only, and asked to do a save as. If I save as, all the data is retained and a new&amp;nbsp;tab is created containing the BOM. This is not ideal because I am prompted for a file name during the save as and the BOM is not saved to the tab I need it to be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 16:05:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7055782#M101218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T16:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7055859#M101219</link>
      <description>&lt;P&gt;Make sure that the excel file is closed while running the iLogic. By default, Inventor iLogic dumps your data to the designated excel file without sorting the data based on your preference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to do some VBA programming in order to define the exact location in the spreadsheet where your data goes to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will give you an idea on how to export a parts list:&lt;/P&gt;&lt;P&gt;&lt;A href="http://inventortrenches.blogspot.ca/2012/06/create-new-excel-file-with-ilogic.html" target="_blank"&gt;http://inventortrenches.blogspot.ca/2012/06/create-new-excel-file-with-ilogic.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 16:26:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7055859#M101219</guid>
      <dc:creator>ShayaGhanbar</dc:creator>
      <dc:date>2017-05-02T16:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056037#M101220</link>
      <description>&lt;P&gt;Shaya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help. I am actually using that code to open and perform a save as of my template file. Since the code is writing data to specific cells I couldn't figure out how to export my BOM with that code, so I decided to try and write another rule to export the BOM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea of how to use that code to export the BOM?&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 17:24:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056037#M101220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T17:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056065#M101221</link>
      <description>&lt;P&gt;Hi jeff.Aguilera,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can search and ask programming questions of this type on the Inventor Customization forum too:&lt;BR /&gt;&lt;A href="http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120" target="_blank"&gt;http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are several related links:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/forums/searchpage/tab/message?advanced=false&amp;amp;allow_punctuation=false&amp;amp;filter=location&amp;amp;location=forum-board%3A120&amp;amp;q=export+BOM" target="_blank"&gt;https://forums.autodesk.com/t5/forums/searchpage/tab/message?advanced=false&amp;amp;allow_punctuation=false&amp;amp;filter=location&amp;amp;location=forum-board%3A120&amp;amp;q=export+BOM&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 17:34:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056065#M101221</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-05-02T17:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056252#M101222</link>
      <description>&lt;P&gt;Hey Jeff,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a VB that I created:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub Main()&lt;/P&gt;&lt;P&gt;Dim oDoc As AssemblyDocument&lt;BR /&gt;Set oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;Dim oBOM As BOM&lt;BR /&gt;Set oBOM = oDoc.ComponentDefinition.BOM&lt;BR /&gt;&lt;BR /&gt;oBOM.PartsOnlyViewEnabled = True&lt;BR /&gt;&lt;BR /&gt;Dim oBOMView As BOMView&lt;BR /&gt;Set oBOMView = oBOM.BOMViews.Item("Parts Only")&lt;BR /&gt;&lt;BR /&gt;Call ExportToExcel(oBOMView.bomRows)&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Function ExportToExcel(bRows As BOMRowsEnumerator)&lt;BR /&gt;Dim xlApp As Excel.Application&lt;BR /&gt;Set xlApp = GetObject("", "Excel.Application.15")&lt;/P&gt;&lt;P&gt;Dim xlWorkbook As Workbook&lt;BR /&gt;Set xlWorkbook = xlApp.Workbooks.Open("C:\SolidCAD\Inventor Training Files\iLOGIC\Beam\Beam Assembly - BOM.xls")&lt;BR /&gt;&lt;BR /&gt;Dim xlWorksheet As WorkSheet&lt;BR /&gt;Set xlWorksheet = xlWorkbook.Worksheets.Item("TEST")&lt;BR /&gt;&lt;BR /&gt;Dim row As Integer&lt;BR /&gt;row = 5&lt;BR /&gt;&lt;BR /&gt;xlWorksheet.Range("B4").Value = "ITEM"&lt;BR /&gt;xlWorksheet.Range("C4").Value = "QTY"&lt;BR /&gt;xlWorksheet.Range("D4").Value = "DESC"&lt;BR /&gt;xlWorksheet.Range("E4").Value = "Part Number"&lt;BR /&gt;&lt;BR /&gt;Dim bRow As bomRow&lt;BR /&gt;For Each bRow In bRows&lt;BR /&gt;Dim rDoc As Document&lt;BR /&gt;Set rDoc = bRow.ComponentDefinitions.Item(1).Document&lt;BR /&gt;&lt;BR /&gt;Dim docPropertySet As PropertySet&lt;BR /&gt;Set docPropertySet = rDoc.PropertySets.Item("Design Tracking Properties")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;xlWorksheet.Range("B" &amp;amp; row).Value = bRow.ItemNumber&lt;BR /&gt;xlWorksheet.Range("C" &amp;amp; row).Value = bRow.ItemQuantity&lt;BR /&gt;xlWorksheet.Range("D" &amp;amp; row).Value = docPropertySet.Item("Description").Value&lt;BR /&gt;xlWorksheet.Range("E" &amp;amp; row).Value = docPropertySet.Item("Part Number").Value&lt;BR /&gt;&lt;BR /&gt;row = row + 1&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;xlWorkbook.Save&lt;BR /&gt;xlWorkbook.Close (False)&lt;BR /&gt;xlApp.Quit&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should give you a good idea of what's involved.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 18:27:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056252#M101222</guid>
      <dc:creator>ShayaGhanbar</dc:creator>
      <dc:date>2017-05-02T18:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056446#M101223</link>
      <description>&lt;P&gt;Shaya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting the following errors when I tried to run this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 16: Type 'Excel.Application' is not defined&lt;/P&gt;&lt;P&gt;Line 18: Type 'Workbook' is not defined&lt;/P&gt;&lt;P&gt;Line 21: Type 'Worksheet' is not defined&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 19:11:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056446#M101223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T19:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056476#M101224</link>
      <description>&lt;P&gt;Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response, I've been thru those forums as well as your blog. I can get the BOM to export, it's just either the pre-existing excel data gets lost or the BOM gets inserted into a new tab that wasn't originally in the excel template I'm using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to find an example where someone needs the BOM to go to specific tab in an excel file with existing data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 19:21:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056476#M101224</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T19:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056497#M101225</link>
      <description>&lt;P&gt;You need to change this:&amp;nbsp;&lt;SPAN&gt;Set xlWorkbook = xlApp.Workbooks.Open("C:\SolidCAD\Inventor Training Files\iLOGIC\Beam\Beam Assembly - BOM.xls") to another location on your computer where there is an excel file with a tab called TEST.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 19:27:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056497#M101225</guid>
      <dc:creator>ShayaGhanbar</dc:creator>
      <dc:date>2017-05-02T19:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056557#M101226</link>
      <description>&lt;P&gt;Shaya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had done that prior to running the rule for the first time....&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 19:48:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056557#M101226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T19:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056613#M101227</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. When exporting the BOM I am prompted that the file I am writing to is read only, and asked to do a save as. If I save as, all the data is retained and a new&amp;nbsp;tab is created containing the BOM. This is not ideal because I am prompted for a file name during the save as and the BOM is not saved to the tab I need it to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi jeff.Aguilera,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Case 2 might occur because your early attempts have opened the Excel invisibly and the code failed without closing it, leaving it open and read only. CTRL + ALT Delete and check your Task Manager for Excel Processes and kill them, if this is the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then try this modified version of ShayaGhan's code, that I tweaked to make it more iLogic friendly. It also makes the Excel file visible which is handy during testing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;But as I understand it, you want to use a template, not an existing file, correct? ShayaGhan's example is using an existing file.&lt;/LI&gt;
&lt;LI&gt;And you want to do this from an assembly, so you must use the BOM, rather than from the Drawing where you could use the Parts List, correct?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I'm short on time, but might be able to get back to this later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM

oBOM.PartsOnlyViewEnabled = True

Dim oBOMView As BOMView
oBOMView = oBOM.BOMViews.Item("Parts Only")

xlApp = CreateObject("Excel.Application")

'comment out or change to false 
'in order to not show Excel
xlApp.Visible = True 

xlWorkbook = xlApp.Workbooks.Open("C:\Temp\Test.xlsx")

xlWorksheet = xlWorkbook.Worksheets.Item("Sheet1")

Dim row As Integer
row = 5

xlWorksheet.Range("B4").Value = "ITEM"
xlWorksheet.Range("C4").Value = "QTY"
xlWorksheet.Range("D4").Value = "DESC"
xlWorksheet.Range("E4").Value = "Part Number"

'Dim bRow As bomRow
bRows = oBOMView.BOMRows
For Each bRow In bRows

	Dim rDoc As Document
	rDoc = bRow.ComponentDefinitions.Item(1).Document
	
	Dim docPropertySet As PropertySet
	docPropertySet = rDoc.PropertySets.Item("Design Tracking Properties")
	
	xlWorksheet.Range("B" &amp;amp; row).Value = bRow.ItemNumber
	xlWorksheet.Range("C" &amp;amp; row).Value = bRow.ItemQuantity
	xlWorksheet.Range("D" &amp;amp; row).Value = docPropertySet.Item("Description").Value
	xlWorksheet.Range("E" &amp;amp; row).Value = docPropertySet.Item("Part Number").Value
	
	row = row + 1
Next

xlWorkbook.Save
xlWorkbook.Close (False)
xlApp.Quit

&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2017 20:15:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056613#M101227</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-05-02T20:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056648#M101228</link>
      <description>&lt;P&gt;update:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realized after I posted that maybe you wanted to use an existing file (not template) and just do a save as, if so something like this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM

oBOM.PartsOnlyViewEnabled = True

Dim oBOMView As BOMView
oBOMView = oBOM.BOMViews.Item("Parts Only")

xlApp = CreateObject("Excel.Application")

'comment out or change to false 
'in order to not show Excel
xlApp.Visible = True 
xlWorkbook = xlApp.Workbooks.Open("C:\Temp\Test.xlsx")

xlWorksheet = xlWorkbook.Worksheets.Item("Sheet1")

Dim row As Integer
row = 5

xlWorksheet.Range("B4").Value = "ITEM"
xlWorksheet.Range("C4").Value = "QTY"
xlWorksheet.Range("D4").Value = "DESC"
xlWorksheet.Range("E4").Value = "Part Number"

'Dim bRow As bomRow
bRows = oBOMView.BOMRows
For Each bRow In bRows

	Dim rDoc As Document
	rDoc = bRow.ComponentDefinitions.Item(1).Document
	
	Dim docPropertySet As PropertySet
	docPropertySet = rDoc.PropertySets.Item("Design Tracking Properties")
	
	xlWorksheet.Range("B" &amp;amp; row).Value = bRow.ItemNumber
	xlWorksheet.Range("C" &amp;amp; row).Value = bRow.ItemQuantity
	xlWorksheet.Range("D" &amp;amp; row).Value = docPropertySet.Item("Description").Value
	xlWorksheet.Range("E" &amp;amp; row).Value = docPropertySet.Item("Part Number").Value
	
	row = row + 1
Next

oNow = DateString &amp;amp; "_" &amp;amp; TimeString
oNow = oNow.Replace("/","_")
oNow = oNow.Replace(":","_")
xlWorkBook.SaveAs(Filename:="C:\Temp\SampleNew_" &amp;amp; oNow &amp;amp; ".xlsx")

xlWorkbook.Close (False)
xlApp.Quit&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2017 20:23:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7056648#M101228</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-05-02T20:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7058571#M101229</link>
      <description>&lt;P&gt;Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks! This works great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reference for finding the proper format for calling the below properties? I was able to get the vendor data to populate by following the docPropertySet format&amp;nbsp;but I get an error when trying to populate the revision and eng. release date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;bRow.ItemNumber
bRow.ItemQuantity
docPropertySet.Item("Description").Value&lt;BR /&gt;docPropertySet.Item("Part Number").Value&lt;/PRE&gt;&lt;P&gt;And yes you are correct, I am trying to copy an excel template file, populate with BOM data from the .iam file, and perform a save as. The reason is we just started using Fusion Lifecycle. BOM data has to be imported into Lifecycle and we have been told by our re-seller and Autodesk that this is a manual process and has not been automated. So I'm trying to use Ilogic to automate this process, but I don't necessarily need to stick with the method I've been working on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initially I was using Ilogic to import an xml file (to get the BOM columns I need), sorting and renumbering the BOM, and copying an excel template file (this would format the BOM data for Lifecycle). The next step was to import the BOM data into this spreadsheet, but as you can see this is where I was getting stuck. But with your code I should be able to achieve all of this in one rule and eliminate the need to import an xml file.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 14:45:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7058571#M101229</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-03T14:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7058588#M101230</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a reference for finding the proper format for calling the below properties?...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;Hi jeff.aguilera,&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;I think those properties are in a different property set, see this link for a reference:&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;A href="http://download.autodesk.com/us/community/mfg/Part_4.pdf" target="_blank"&gt;http://download.autodesk.com/us/community/mfg/Part_4.pdf&lt;/A&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 03 May 2017 14:51:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7058588#M101230</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-05-03T14:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7308414#M101231</link>
      <description>&lt;P&gt;hello , i have seen you code,and it works well, but now i want export another properties like material, mass,keywords etc. how to make it? &amp;nbsp;thanks forward!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	xlWorksheet.Range("B" &amp;amp; row).Value = bRow.ItemNumber
	xlWorksheet.Range("C" &amp;amp; row).Value = bRow.ItemQuantity
	xlWorksheet.Range("D" &amp;amp; row).Value = docPropertySet.Item("Description").Value
	xlWorksheet.Range("E" &amp;amp; row).Value = docPropertySet.Item("Part Number").Value&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 15:50:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7308414#M101231</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-17T15:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7308985#M101232</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a potential solution for just directly exporting the BOM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is currently excluding error checking, so if there is issues&lt;/P&gt;
&lt;P&gt;a) exporting the BOM from inventor,&lt;/P&gt;
&lt;P&gt;b)opening excel,&lt;/P&gt;
&lt;P&gt;c) grabbing the workbooks or&lt;/P&gt;
&lt;P&gt;d) renaming the sheet,&lt;/P&gt;
&lt;P&gt;it will cause the program to&amp;nbsp;exit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It also only works for a structuredBOM with full levels, and will move it to the last sheet, renamed to the 2nd arguement in the calling method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;
    
    &lt;SPAN&gt;ExportBOMToExistingExcel&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;C:\Users\JRK\Desktop\HCD BOM.xlsx&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;$BOM&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;End Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;ExportBOMToExistingExcel&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oxlName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;oxlSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;ExportBOMToExistingExcel - by MechMachineMan on Inventor Customization Forums&lt;/SPAN&gt;
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Purpose: To export a BOM to an existing excel file as a workaround to inventor's native behaviour of&lt;/SPAN&gt;
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;          wiping the destination file of the export.&lt;/SPAN&gt;
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Method:  This sub will simply create a temporary excel file, and then copy the sheet to the destination document.&lt;/SPAN&gt;
  
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Change this temp file to something that works for you better, if desired. &lt;/SPAN&gt;
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Is currently a Generic location To make it portable.&lt;/SPAN&gt;
    &lt;SPAN&gt;oTemporaryExcelFile&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;C:\Users\Public\Documents\iLogic Buffer File.xlsx&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
    
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;xlApp&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Object&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;workingwb&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Object&lt;/SPAN&gt;
    
    &lt;SPAN&gt;Try&lt;/SPAN&gt;    
        &lt;SPAN&gt;ExportBOMToTemp&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oTemporaryExcelFile&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    
        &lt;SPAN&gt;xlApp&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;CreateObject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Excel.Application&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    
        &lt;SPAN&gt;workingwb&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;xlApp&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Workbooks&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oxlName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    
        &lt;SPAN&gt;sourcewb&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;xlApp&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Workbooks&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oTemporaryExcelFile&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
        &lt;SPAN&gt;sourcews&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;sourcewb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sheets&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    
        &lt;SPAN&gt;sourcews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;After&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;workingwb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sheets&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;workingwb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sheets&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Count&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;
        &lt;SPAN&gt;workingws&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;workingwb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sheets&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;workingwb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Sheets&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Count&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
        &lt;SPAN&gt;workingws&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Name&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oxlSheet&lt;/SPAN&gt;   
        
        &lt;SPAN&gt;sourcewb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Close&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;
    &lt;SPAN&gt;Catch&lt;/SPAN&gt;
        &lt;SPAN&gt;MsgBox&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Error During Export Encountered!&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
    
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;xlApp&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Visible&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;True&lt;/SPAN&gt;    
        &lt;SPAN&gt;workingwb&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
        &lt;SPAN&gt;xlApp&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN&gt;Catch&lt;/SPAN&gt;
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
    
    &lt;SPAN&gt;releaseObject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;workingws&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;releaseObject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sourcewb&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;releaseObject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;workingwb&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;releaseObject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;xlApp&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    
&lt;SPAN&gt;End Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;ExportBOMToTemp&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oTempFile&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Do not mod where tempfile appears; only mod to get parts only if desired.&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;
    &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;

    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOM&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOM&lt;/SPAN&gt;
    &lt;SPAN&gt;oBOM&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;BOM&lt;/SPAN&gt;
    
    &lt;SPAN&gt;oBOM&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;StructuredViewFirstLevelOnly&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;False&lt;/SPAN&gt;
    &lt;SPAN&gt;oBOM&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;StructuredViewEnabled&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;True&lt;/SPAN&gt;

    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oStructuredBOMView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOMView&lt;/SPAN&gt;
    &lt;SPAN&gt;oStructuredBOMView&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oBOM&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;BOMViews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Structured&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    
    &lt;SPAN&gt;oStructuredBOMView&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Export&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oTempFile&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;kMicrosoftExcelFormat&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;End Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;releaseObject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ByVal&lt;/SPAN&gt; &lt;SPAN&gt;obj&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Object&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;System&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Runtime&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;InteropServices&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Marshal&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReleaseComObject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;obj&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
        &lt;SPAN&gt;obj&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN&gt;Catch&lt;/SPAN&gt; &lt;SPAN&gt;ex&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Exception&lt;/SPAN&gt;
        &lt;SPAN&gt;obj&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN&gt;Finally&lt;/SPAN&gt;
        &lt;SPAN&gt;GC&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Collect&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 18:57:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7308985#M101232</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-08-17T18:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7574461#M101233</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script does not want to export purchased and apparent parts.&lt;/P&gt;&lt;P&gt;Any idea ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 163px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/431159i9B535088C90EA43D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 10:25:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7574461#M101233</guid>
      <dc:creator>idealogicERZYZ</dc:creator>
      <dc:date>2017-11-27T10:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7575062#M101234</link>
      <description>&lt;P&gt;The code is supposed to export the ENTIRE structured BOM tab. Please verify the virtual components you are wanting to export are showing up in your STRUCTURED BOM View... Perhaps they are set to reference somehow...&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 14:03:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7575062#M101234</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-27T14:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7575310#M101235</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So they appear.&lt;BR /&gt;With the Export icon - the structure is exported.&lt;BR /&gt;Code rule no longer exports.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/431311i3337764372FD6443/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 14:58:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7575310#M101235</guid>
      <dc:creator>idealogicERZYZ</dc:creator>
      <dc:date>2017-11-27T14:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic code to export BOM to excel file overwrites data in excel file</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7811452#M101236</link>
      <description>&lt;P&gt;Hi Curtis&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm currently trayng to adapt Your's code for creating parts list. What i would like to do is to write list to a embedded 3rdt Party xls file in a assembly so i could create a template of these assembly. In company that I work we have to make for every project 3 lists: Structured without connectors screws, nuts and so on; parts only list without&amp;nbsp; connectors screws, nuts and so on; and finaly only connectors list. Could it be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 06:56:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-code-to-export-bom-to-excel-file-overwrites-data-in-excel/m-p/7811452#M101236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-27T06:56:55Z</dc:date>
    </item>
  </channel>
</rss>

