<?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: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582897#M61954</link>
    <description>&lt;P&gt;Good catch &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1734991"&gt;@marcin_otręba&lt;/a&gt; .&amp;nbsp; I saw that earlier, but since I didn't attempt to test the code, it didn't 'click'.&lt;/P&gt;&lt;P&gt;By the way, I see you using the line "ErHa = " several times throughout the code, but don't see where you set its Type as String.&amp;nbsp; Is that causing any problems?&amp;nbsp; (Usually doesn't, but depending on if you have certain options set for strictness, it might.)&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2020 15:36:26 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2020-06-16T15:36:26Z</dc:date>
    <item>
      <title>Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582441#M61948</link>
      <description>&lt;P&gt;Hello forum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a small program that does cost and pricing reports. I've been searching and trouble shooting a few lines of code that I have found on this forum (Thank you &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2232990"&gt;@Neuzzo&lt;/a&gt; for presenting the original bulk of the code). I had to modify the code to update the 'Estimated Cost' in iproperties of each part at the assembly level. But I've stitched up a few lines of code that worked for me when I'm running at the part level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now its a mess of code that doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code as it is right now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;'Create variables'set a reference to the assembly component definintion&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAssDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;'Dim ExcelFullName As String&lt;/SPAN&gt;
&lt;SPAN&gt;'Dim FileName As String &lt;/SPAN&gt;


&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;FileDialog&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
&lt;SPAN&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN&gt;Application&lt;/SPAN&gt;.&lt;SPAN&gt;CreateFileDialog&lt;/SPAN&gt;(&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;)
&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;InitialDirectory&lt;/SPAN&gt; = &lt;SPAN&gt;oOrigRefName&lt;/SPAN&gt;
&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;CancelError&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;

&lt;SPAN&gt;'oFileDlg.ShowOpen()&lt;/SPAN&gt;
&lt;SPAN&gt;'If Err.Number &amp;lt;&amp;gt; 0 Then&lt;/SPAN&gt;
&lt;SPAN&gt;'Return&lt;/SPAN&gt;
&lt;SPAN&gt;'ElseIf oFileDlg.FileName &amp;lt;&amp;gt; "" Then&lt;/SPAN&gt;
&lt;SPAN&gt;'ExcelFullName = oFileDlg.FileName&lt;/SPAN&gt;
&lt;SPAN&gt;'End If&lt;/SPAN&gt;

&lt;SPAN&gt;'Open Excel database&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;(&lt;SPAN&gt;"\\&lt;STRONG&gt;SRV-DOC&lt;/STRONG&gt;\&lt;STRONG&gt;company folder&lt;/STRONG&gt;\&lt;STRONG&gt;program name&lt;/STRONG&gt;\&lt;STRONG&gt;product family&lt;/STRONG&gt;\&lt;STRONG&gt;pricing.xlsx&lt;/STRONG&gt;", "&lt;STRONG&gt;sheet name&lt;/STRONG&gt;"&lt;/SPAN&gt;)

&lt;SPAN&gt;'Iterate through each referenced document&lt;/SPAN&gt;
&lt;SPAN&gt;'Dim oOcc As ComponentOccurrence&lt;/SPAN&gt;
    &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAssDoc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Start"&lt;/SPAN&gt;
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;'Extract Part Number of active occurrence &lt;/SPAN&gt;
        &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPropSet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Inventor User Defined Properties"&lt;/SPAN&gt;)
        &lt;SPAN&gt;oPartNumber&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt;
                    
        &lt;SPAN&gt;'MessageBox.Show(oPartNumber)&lt;/SPAN&gt;

    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Define custom property collection"&lt;/SPAN&gt;
	&lt;SPAN&gt;'Parameter.UpdateAfterChange = True &lt;/SPAN&gt;
	&lt;SPAN&gt;'index row 5 through 100 or 150 or 10,000 (too long processing time)&lt;/SPAN&gt;
&lt;SPAN&gt;	GoExcel.Open("\\&lt;STRONG&gt;SRV-DOC&lt;/STRONG&gt;\&lt;STRONG&gt;company folder&lt;/STRONG&gt;\&lt;STRONG&gt;program name&lt;/STRONG&gt;\&lt;STRONG&gt;product family&lt;/STRONG&gt;\&lt;STRONG&gt;pricing.xlsx&lt;/STRONG&gt;", "&lt;STRONG&gt;sheet name&lt;/STRONG&gt;")&lt;/SPAN&gt;
&lt;SPAN&gt;	For &lt;STRONG&gt;rowPN = 5 To 60&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN&gt;	'find first empty cell in column A&lt;/SPAN&gt;
&lt;SPAN&gt;	If (GoExcel.CellValue(&lt;STRONG&gt;"A" &amp;amp; rowPN&lt;/STRONG&gt;) = iProperties.Value(&lt;STRONG&gt;oPartNumber&lt;/STRONG&gt;, "&lt;STRONG&gt;Part Number&lt;/STRONG&gt;")) Then&lt;/SPAN&gt;
&lt;SPAN&gt;	'find the price of the part using the part number&lt;/SPAN&gt;
&lt;SPAN&gt;	oPrice = GoExcel.CellValue(&lt;STRONG&gt;"L" &amp;amp; rowPN&lt;/STRONG&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt; 	End If&lt;/SPAN&gt;
&lt;SPAN&gt;	Next&lt;/SPAN&gt;
&lt;SPAN&gt;	'MessageBox.Show(&lt;STRONG&gt;oPrice&lt;/STRONG&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;	iProperties.Value(&lt;STRONG&gt;oPartNumber, "Estimated Cost"&lt;/STRONG&gt;) = &lt;STRONG&gt;oPrice&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;BR /&gt;ErHa = "Define custom property collection"&lt;/SPAN&gt;
&lt;SPAN&gt;	Parameter.UpdateAfterChange = True	      &lt;/SPAN&gt;
        &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;"\\&lt;STRONG&gt;SRV-DOC&lt;/STRONG&gt;\&lt;STRONG&gt;company folder&lt;/STRONG&gt;\&lt;STRONG&gt;program name&lt;/STRONG&gt;\&lt;STRONG&gt;product family&lt;/STRONG&gt;\&lt;STRONG&gt;pricing.xlsx&lt;/STRONG&gt;"&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;sheet name&lt;/STRONG&gt;"&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;Part Number&lt;/STRONG&gt;"&lt;/SPAN&gt;) &lt;SPAN&gt;'"=", &lt;STRONG&gt;oPartNumber&lt;/STRONG&gt;)&lt;/SPAN&gt;
		
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;"-1"&lt;/SPAN&gt; 
			&lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;oEnd&lt;/SPAN&gt;
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
		
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPrice&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CurrentRowValue&lt;/SPAN&gt;(&lt;SPAN&gt;"&lt;STRONG&gt;Price&lt;/STRONG&gt;"&lt;/SPAN&gt;)
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;.&lt;SPAN&gt;IsNullOrEmpty&lt;/SPAN&gt;(&lt;STRONG&gt;oPrice&lt;/STRONG&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;Estimated Cost&lt;/STRONG&gt;"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;""&lt;/SPAN&gt;
        &lt;SPAN&gt;Else&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;Estimated Cost&lt;/STRONG&gt;"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;STRONG&gt;oPrice&lt;/STRONG&gt;
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
		

    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Update the file"&lt;/SPAN&gt;
        &lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&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;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Part: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"Code-Part: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ErHa&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"Error: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ex&lt;/SPAN&gt;.&lt;SPAN&gt;Message&lt;/SPAN&gt;)  
    
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;oEnd&lt;/SPAN&gt;:
    &lt;SPAN&gt;Next&lt;/SPAN&gt; 
&lt;SPAN&gt;'Close Excel database&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Private&lt;/SPAN&gt; &lt;SPAN&gt;ErHa&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;vbNullString&lt;/SPAN&gt;

&lt;SPAN&gt;Function&lt;/SPAN&gt; &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropset&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt;, &lt;SPAN&gt;iProName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;) &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Property&lt;/SPAN&gt;
    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"GetProperty: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;iProName&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;iPro&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Property&lt;/SPAN&gt;
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;'Attempt to get the iProperty from the document&lt;/SPAN&gt;
        &lt;SPAN&gt;iPro&lt;/SPAN&gt; = &lt;SPAN&gt;oPropset&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;iProName&lt;/SPAN&gt;)
    &lt;SPAN&gt;Catch&lt;/SPAN&gt;
        &lt;SPAN&gt;'Assume error means not found, so create it&lt;/SPAN&gt;
        &lt;SPAN&gt;iPro&lt;/SPAN&gt; = &lt;SPAN&gt;oPropset&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;iProName&lt;/SPAN&gt;)
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
    &lt;SPAN&gt;Return&lt;/SPAN&gt; &lt;SPAN&gt;iPro&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Part numbers on my excel sheet are found on along the column &lt;STRONG&gt;A&lt;/STRONG&gt; and begin on&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;A5&amp;nbsp;&lt;/STRONG&gt;and its associated pricing are found under the column &lt;STRONG&gt;L&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following iLogic code searches for the part number and its price:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	&lt;SPAN&gt;'index row 5 through 100 or 150 or 10,000 (too long processing time)&lt;/SPAN&gt;
	&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;(&lt;SPAN&gt;"\\SRV-DOC\MURAFLEX\CONFIGURATOR\MSD-M-B101-00\SAS-003X-01.xlsx"&lt;/SPAN&gt;, &lt;SPAN&gt;"SAS-003X-XX"&lt;/SPAN&gt;)
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;rowPN&lt;/SPAN&gt; = 5 &lt;SPAN&gt;To&lt;/SPAN&gt; 60
	&lt;SPAN&gt;'find first empty cell in column A&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; (&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CellValue&lt;/SPAN&gt;(&lt;SPAN&gt;"A"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;rowPN&lt;/SPAN&gt;) = &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oPartNumber&lt;/SPAN&gt;, &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;)) &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;'find the price of the part using the part number&lt;/SPAN&gt;
	&lt;SPAN&gt;oPrice&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CellValue&lt;/SPAN&gt;(&lt;SPAN&gt;"L"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;rowPN&lt;/SPAN&gt;)
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the code should match the part numbers on the excel sheet and return a price from excel:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	&lt;SPAN&gt;'MessageBox.Show(oPrice)&lt;/SPAN&gt;
	'&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oPartNumber&lt;/SPAN&gt;, &lt;SPAN&gt;"Estimated Cost"&lt;/SPAN&gt;) = &lt;SPAN&gt;oPrice&lt;/SPAN&gt;
	  &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Define custom property collection"&lt;/SPAN&gt;
	&lt;SPAN&gt;Parameter&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateAfterChange&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;	      
        &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;"\\SRV-DOC\MURAFLEX\CONFIGURATOR\MSD-M-B101-00\SAS-003X-01.xlsx"&lt;/SPAN&gt;, &lt;SPAN&gt;"SAS-003X-XX"&lt;/SPAN&gt;, &lt;SPAN&gt;"PART NUMBER"&lt;/SPAN&gt;) &lt;SPAN&gt;'"=", oPartNumber)&lt;/SPAN&gt;
		&lt;SPAN&gt;'i = GoExcel.FindRow(ExcelFullName, "DISTINTA BASE", "Part Number", "=", oPartNumber)&lt;/SPAN&gt;
		
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;"-1"&lt;/SPAN&gt; 
			&lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;oEnd&lt;/SPAN&gt;
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;And then the price found in excel should update the iproperties value Estimated Cost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPrice&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CurrentRowValue&lt;/SPAN&gt;(&lt;SPAN&gt;"PRICE"&lt;/SPAN&gt;)
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;.&lt;SPAN&gt;IsNullOrEmpty&lt;/SPAN&gt;(&lt;SPAN&gt;oPrice&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;'If String.IsNullOrEmpty(oCost) Then&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"Estimated Cost"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;""&lt;/SPAN&gt;
        &lt;SPAN&gt;Else&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"Estimated Cost"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;oPrice&lt;/SPAN&gt;
		&lt;SPAN&gt;'GetProperty(oPropSet, "Estimated Cost").Value = oCost&lt;/SPAN&gt;
		&lt;SPAN&gt;'GetProperty(oPropSet, "Tipo ricambio").Value = "C"&lt;/SPAN&gt;
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that whenever I run the iLogic code it doesn't update the Estimated Costs as expected and return an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help would be greatly appreciated by me and others that may benefit from this.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 13:06:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582441#M61948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T13:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582516#M61949</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="error.PNG" style="width: 370px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/784221i1DE5BE6D65A65666/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.PNG" alt="error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error... I do have a column titled Part Number, what am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 13:35:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582516#M61949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T13:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582720#M61950</link>
      <description>&lt;P&gt;Do you know precisely where within your code the problem happens?&lt;/P&gt;&lt;P&gt;Have you tried placing a bunch of MsgBox("1"), MsgBox("2"), etc, throughout the code that will show you the last location that runs without errors, or some other similar debug technique?&lt;/P&gt;&lt;P&gt;It would be nearly impossible for us to test your code without having your files to experiment with.&lt;/P&gt;&lt;P&gt;But don't post your files if they contain private or proprietary info.&lt;/P&gt;&lt;P&gt;Perhaps if you created a very simplified version of your files that are attempting to do the same type of thing, you could post them here, for testing, so we can better help you solve your problem.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 14:37:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582720#M61950</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T14:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582811#M61951</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class="UserName lia-user-name lia-user-rank-Advocate lia-component-message-view-widget-author-username"&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054" target="_self"&gt;&lt;SPAN class=""&gt;WCrihfield&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With regards to isolating the error...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error occurs at&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;"Define custom property collection"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The message box appears when inventor reads this line of code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However spending the last 5 hours trouble shooting this and at times the message box not appearing... I still can't get the estimated costs in iproperties to &lt;STRONG&gt;update&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With regards to your message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simply put, what I would like this code to do (running within an assembly) is to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;EM&gt;retrieve&lt;/EM&gt; an excel file&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;find&lt;/EM&gt; the column titled Part Number&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;match&lt;/EM&gt; the part number of an assembly item with that of a part number in excel&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;find&lt;/EM&gt; the price along the row of that part number&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;read&lt;/EM&gt; the price in excel and...&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;write&lt;/EM&gt; that same price in the iproperties "estimated cost" of each part of the assembly&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I'm fairly new to VB and ilogic and so far I've been copying and pasting and modifying code to run tasks that I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to get this one working.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 15:09:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582811#M61951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T15:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582833#M61952</link>
      <description>&lt;P&gt;i think in line :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; &lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"\\SRV-DOC\company folder\program name\product family\pricing.xlsx"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"sheet name"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;) &lt;SPAN style="color: #808080;"&gt;'"=", oPartNumber)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;is error and should be :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"\\SRV-DOC\company folder\program name\product family\pricing.xlsx"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"sheet name"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"="&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oPartNumber&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 15:16:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582833#M61952</guid>
      <dc:creator>marcin_otręba</dc:creator>
      <dc:date>2020-06-16T15:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582892#M61953</link>
      <description>&lt;P&gt;Ok, so I decided to start from the original source code and modify it....&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;'Create variables'set a reference to the assembly component definintion&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAssDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;FileName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; 


&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;FileDialog&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
&lt;SPAN&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN&gt;Application&lt;/SPAN&gt;.&lt;SPAN&gt;CreateFileDialog&lt;/SPAN&gt;(&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;)
&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;InitialDirectory&lt;/SPAN&gt; = &lt;SPAN&gt;oOrigRefName&lt;/SPAN&gt;
&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;CancelError&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;

&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;ShowOpen&lt;/SPAN&gt;()
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Err&lt;/SPAN&gt;.&lt;SPAN&gt;Number&lt;/SPAN&gt; &amp;lt;&amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;Return&lt;/SPAN&gt;
&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;"&lt;/SPAN&gt;\\&lt;STRONG&gt;SRV-DOC&lt;/STRONG&gt;\&lt;STRONG&gt;COMPANY_NAME&lt;/STRONG&gt;\&lt;STRONG&gt;PROGRAM_NAME&lt;/STRONG&gt;\&lt;STRONG&gt;PRODUCT_FAMILY&lt;/STRONG&gt;\&lt;STRONG&gt;PRODUCT_NUMBER.xlsx&lt;/STRONG&gt;" &lt;SPAN style="white-space: normal;"&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt; = &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;'Open Excel database&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;(&lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt;,&lt;SPAN&gt;"&lt;STRONG&gt;PRODUCT NUMBER&lt;/STRONG&gt;"&lt;/SPAN&gt;)

&lt;SPAN&gt;'Iterate through each referenced document'Dim oOcc As ComponentOccurrence&lt;/SPAN&gt;
    &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAssDoc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Start"&lt;/SPAN&gt;
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;'Extract Part Number of active occurrence &lt;/SPAN&gt;
        &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPropSet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Inventor User Defined Properties"&lt;/SPAN&gt;)
        &lt;STRONG&gt;oPartNumber&lt;/STRONG&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"&lt;STRONG&gt;Part Number&lt;/STRONG&gt;"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt;
                    
        &lt;SPAN&gt;'MessageBox.Show(oPartNumber)&lt;/SPAN&gt;

    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Define custom property collection"&lt;/SPAN&gt;
        &lt;SPAN&gt;Parameter&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateAfterChange&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;       
       &lt;SPAN&gt;i&lt;/SPAN&gt; = (&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;PRODUCT NUMBER&lt;/STRONG&gt;"&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;Part Number&lt;/STRONG&gt;"&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;=&lt;/STRONG&gt;"&lt;/SPAN&gt;, &lt;STRONG&gt;oPartNumber&lt;/STRONG&gt;))
		&lt;SPAN&gt;'If i = "-1" &lt;/SPAN&gt;
		&lt;SPAN&gt;'	GoTo PROSSIMO&lt;/SPAN&gt;
		&lt;SPAN&gt;'End If&lt;/SPAN&gt;
		
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;COSTO&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CurrentRowValue&lt;/SPAN&gt;(&lt;SPAN&gt;"Price"&lt;/SPAN&gt;)
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;.&lt;SPAN&gt;IsNullOrEmpty&lt;/SPAN&gt;(&lt;SPAN&gt;COSTO&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;Estimated Cost&lt;/STRONG&gt;"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;""&lt;/SPAN&gt;
        &lt;SPAN&gt;Else&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;STRONG&gt;Estimated Cost&lt;/STRONG&gt;"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;COSTO&lt;/SPAN&gt;
&lt;SPAN&gt;'		GetProperty(oPropSet, "Tipo ricambio").Value = "C"&lt;/SPAN&gt;
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Update the file"&lt;/SPAN&gt;
        &lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&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;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Part: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"Code-Part: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ErHa&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"Error: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ex&lt;/SPAN&gt;.&lt;SPAN&gt;Message&lt;/SPAN&gt;)  
    
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;PROSSIMO&lt;/SPAN&gt;:
    &lt;SPAN&gt;Next&lt;/SPAN&gt; 
&lt;SPAN&gt;'Close Excel database&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Private&lt;/SPAN&gt; &lt;SPAN&gt;ErHa&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;vbNullString&lt;/SPAN&gt;

&lt;SPAN&gt;Function&lt;/SPAN&gt; &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropset&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt;, &lt;SPAN&gt;iProName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;) &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Property&lt;/SPAN&gt;
    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"GetProperty: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;iProName&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;iPro&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Property&lt;/SPAN&gt;
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;'Attempt to get the iProperty from the document&lt;/SPAN&gt;
        &lt;SPAN&gt;iPro&lt;/SPAN&gt; = &lt;SPAN&gt;oPropset&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;iProName&lt;/SPAN&gt;)
    &lt;SPAN&gt;Catch&lt;/SPAN&gt;
        &lt;SPAN&gt;'Assume error means not found, so create it&lt;/SPAN&gt;
        &lt;SPAN&gt;iPro&lt;/SPAN&gt; = &lt;SPAN&gt;oPropset&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;iProName&lt;/SPAN&gt;)
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
    &lt;SPAN&gt;Return&lt;/SPAN&gt; &lt;SPAN&gt;iPro&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But now I get the following error:&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-center" image-alt="message 1.PNG" style="width: 370px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/784315i5EAE6227C39C62D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="message 1.PNG" alt="message 1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it can't find the column titled Part Number ... this title is found on cell A4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to specify somewhere in the code where to&amp;nbsp;&lt;EM&gt;start&lt;/EM&gt; reading the part numbers, in this case A5?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 15:39:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582892#M61953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T15:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582897#M61954</link>
      <description>&lt;P&gt;Good catch &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1734991"&gt;@marcin_otręba&lt;/a&gt; .&amp;nbsp; I saw that earlier, but since I didn't attempt to test the code, it didn't 'click'.&lt;/P&gt;&lt;P&gt;By the way, I see you using the line "ErHa = " several times throughout the code, but don't see where you set its Type as String.&amp;nbsp; Is that causing any problems?&amp;nbsp; (Usually doesn't, but depending on if you have certain options set for strictness, it might.)&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 15:36:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582897#M61954</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T15:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582899#M61955</link>
      <description>&lt;P&gt;can you share here your excel ?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 15:37:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582899#M61955</guid>
      <dc:creator>marcin_otręba</dc:creator>
      <dc:date>2020-06-16T15:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582927#M61956</link>
      <description>&lt;P&gt;There may be a couple lines missing that may help clear this up.&lt;/P&gt;&lt;P&gt;Try setting the GoExcel.TitleRow and GoExcel.FindRowStart.&amp;nbsp; Those help when your column titles aren't on the top row, and when your first data entries aren't on the second row.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 15:46:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9582927#M61956</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T15:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583002#M61957</link>
      <description>&lt;P&gt;Here's a simplified version of my excel... Please see attached.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:15:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583002#M61957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T16:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583020#M61958</link>
      <description>&lt;P&gt;The reason is that you have first row blank.&lt;/P&gt;&lt;P&gt;Also&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #800000;"&gt;i&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"C:\Vault\PRODUCT_NUMBER.xlsx"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Sheet1"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Part Number"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"="&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"XXX-00XX-0X"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;is case sensitive and in excel you have upper cases.&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="marcin_otręba_0-1592324498756.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/784339iFC7D9ECA834CD089/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marcin_otręba_0-1592324498756.png" alt="marcin_otręba_0-1592324498756.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:22:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583020#M61958</guid>
      <dc:creator>marcin_otręba</dc:creator>
      <dc:date>2020-06-16T16:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583044#M61959</link>
      <description>&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oXLfile&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"C:\Temp\PRODUCT_NUMBER.xlsx"&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Sheet1"&lt;/SPAN&gt;
&lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;TitleRow&lt;/SPAN&gt; = 2
&lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;FindRowStart&lt;/SPAN&gt; = 3
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRow&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oXLfile&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oSheet&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"PART NUMBER"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"="&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"XXX-00XX-0X"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPrice&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;CurrentRowValue&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"PRICE"&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPrice&lt;/SPAN&gt;)&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:30:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583044#M61959</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T16:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583054#M61960</link>
      <description>&lt;P&gt;Hi W!&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-center" image-alt="error.PNG" style="width: 370px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/784335i69A8B65AEC2817E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.PNG" alt="error.PNG" /&gt;&lt;/span&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok so from what I understand, the error occurs above when I haven't defined the starting row and title row when calling out excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using&amp;nbsp;&lt;SPAN&gt;GoExcel.TitleRow and GoExcel.FindRowStart should fix the error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So in the "Define custom property collection" I should write the following (sorry I'm writing outloud):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If GoExcel.TitleRow&lt;/SPAN&gt;("A" &amp;amp; 2) AND &lt;SPAN&gt;GoExcel.FindRowStart("A" &amp;amp; 3) Then, match part numbers&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Is this correct?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:32:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583054#M61960</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T16:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583075#M61961</link>
      <description>&lt;P&gt;No. Don't write it as if you're asking a question of the code.&amp;nbsp; Those are setting statements.&amp;nbsp; You have to tell it where your Title row is (Row # 2 in the example file). and you have to tell it where your first row of data starts (Row # 3 in your example file).&amp;nbsp; The same way I have it in my last example code.&amp;nbsp; After you have set those settings, the FindRow knows where to start looking, and it knows where to start looking for the Title row, when you specify it.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:37:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583075#M61961</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T16:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583078#M61962</link>
      <description>&lt;P&gt;By the way, this process doesn't like empty rows, so you may have to put a check in there to make sure the value is not Nothing, so it won't throw an error when trying to process a blank row.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:39:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583078#M61962</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T16:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583113#M61963</link>
      <description>&lt;P&gt;Ok fantasic!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're both right, when calling excel its case sensitive and that its important to reference the title row and starting row before reading the any excel value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the code is as follows:&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;'Create variables'set a reference to the assembly component definintion&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAssDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;FileName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; 


&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;FileDialog&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
&lt;SPAN&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN&gt;Application&lt;/SPAN&gt;.&lt;SPAN&gt;CreateFileDialog&lt;/SPAN&gt;(&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;)
&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;InitialDirectory&lt;/SPAN&gt; = &lt;SPAN&gt;oOrigRefName&lt;/SPAN&gt;
&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;CancelError&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;

&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;ShowOpen&lt;/SPAN&gt;()
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Err&lt;/SPAN&gt;.&lt;SPAN&gt;Number&lt;/SPAN&gt; &amp;lt;&amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;Return&lt;/SPAN&gt;
&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt; &amp;lt;&amp;gt; "\\SRV-DOC\company folder\program name\product family\pricing.xlsx", &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt; = &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;'Open Excel database&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;(&lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt;,&lt;SPAN&gt;"Sheet1"&lt;/SPAN&gt;)

&lt;SPAN&gt;'Iterate through each referenced document'Dim oOcc As ComponentOccurrence&lt;/SPAN&gt;
    &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAssDoc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Start"&lt;/SPAN&gt;
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;'Extract Part Number of active occurrence &lt;/SPAN&gt;
        &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPropSet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Inventor User Defined Properties"&lt;/SPAN&gt;)
        &lt;SPAN&gt;oPartNumber&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt;
                    
        &lt;SPAN&gt;'MessageBox.Show(oPartNumber)&lt;/SPAN&gt;

    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Define custom property collection"&lt;/SPAN&gt;
        &lt;SPAN&gt;Parameter&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateAfterChange&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oXLfile&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"\\SRV-DOC\company folder\program name\product family\pricing.xlsx"&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"Sheet1"&lt;/SPAN&gt;
		&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;TitleRow&lt;/SPAN&gt; = 2
		&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;FindRowStart&lt;/SPAN&gt; = 5
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oRow&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;oXLfile&lt;/SPAN&gt;, &lt;SPAN&gt;oSheet&lt;/SPAN&gt;, &lt;SPAN&gt;"PART NUMBER"&lt;/SPAN&gt;, &lt;SPAN&gt;"="&lt;/SPAN&gt;, &lt;SPAN&gt;oPartNumber&lt;/SPAN&gt;)
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPrice&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CurrentRowValue&lt;/SPAN&gt;(&lt;SPAN&gt;"PRICE"&lt;/SPAN&gt;)
		'&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;oPrice&lt;/SPAN&gt;)
       &lt;SPAN&gt;i&lt;/SPAN&gt; = (&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;ExcelFullName&lt;/SPAN&gt;, &lt;SPAN&gt;"Sheet1"&lt;/SPAN&gt;, &lt;SPAN&gt;"PART NUMBER"&lt;/SPAN&gt;, &lt;SPAN&gt;"="&lt;/SPAN&gt;, &lt;SPAN&gt;oPartNumber&lt;/SPAN&gt;))
		&lt;SPAN&gt;'If i = "-1" &lt;/SPAN&gt;
		&lt;SPAN&gt;'	GoTo PROSSIMO&lt;/SPAN&gt;
		&lt;SPAN&gt;'End If&lt;/SPAN&gt;
		
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;COSTO&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CurrentRowValue&lt;/SPAN&gt;(&lt;SPAN&gt;"PRICE"&lt;/SPAN&gt;)
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;.&lt;SPAN&gt;IsNullOrEmpty&lt;/SPAN&gt;(&lt;SPAN&gt;COSTO&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"Estimated Cost"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;""&lt;/SPAN&gt;
        &lt;SPAN&gt;Else&lt;/SPAN&gt;
        &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropSet&lt;/SPAN&gt;, &lt;SPAN&gt;"Estimated Cost"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;COSTO&lt;/SPAN&gt;
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"Update the file"&lt;/SPAN&gt;
        &lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&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;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Part: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"Code-Part: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ErHa&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"Error: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ex&lt;/SPAN&gt;.&lt;SPAN&gt;Message&lt;/SPAN&gt;)  
    
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;PROSSIMO&lt;/SPAN&gt;:
    &lt;SPAN&gt;Next&lt;/SPAN&gt; 
&lt;SPAN&gt;'Close Excel database&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Private&lt;/SPAN&gt; &lt;SPAN&gt;ErHa&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;vbNullString&lt;/SPAN&gt;

&lt;SPAN&gt;Function&lt;/SPAN&gt; &lt;SPAN&gt;GetProperty&lt;/SPAN&gt;(&lt;SPAN&gt;oPropset&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt;, &lt;SPAN&gt;iProName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;) &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Property&lt;/SPAN&gt;
    &lt;SPAN&gt;ErHa&lt;/SPAN&gt; = &lt;SPAN&gt;"GetProperty: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;iProName&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;iPro&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Property&lt;/SPAN&gt;
    &lt;SPAN&gt;Try&lt;/SPAN&gt;
        &lt;SPAN&gt;'Attempt to get the iProperty from the document&lt;/SPAN&gt;
        &lt;SPAN&gt;iPro&lt;/SPAN&gt; = &lt;SPAN&gt;oPropset&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;iProName&lt;/SPAN&gt;)
    &lt;SPAN&gt;Catch&lt;/SPAN&gt;
        &lt;SPAN&gt;'Assume error means not found, so create it&lt;/SPAN&gt;
        &lt;SPAN&gt;iPro&lt;/SPAN&gt; = &lt;SPAN&gt;oPropset&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;iProName&lt;/SPAN&gt;)
    &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
    &lt;SPAN&gt;Return&lt;/SPAN&gt; &lt;SPAN&gt;iPro&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;But when I right click on each part to see its iproperties the 'Estimate Cost' is&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; updating. What am I missing here?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:51:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583113#M61963</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T16:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583124#M61964</link>
      <description>&lt;P&gt;I think I need to fit this line of code somewhere...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'set&amp;nbsp;iProperty&amp;nbsp;to&amp;nbsp;value&amp;nbsp;from&amp;nbsp;excel&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;iProperties.Value(&lt;/SPAN&gt;&lt;SPAN&gt;"Project"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Estimated&amp;nbsp;Cost"&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;nbsp;oPrice&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:55:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583124#M61964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T16:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583160#M61965</link>
      <description>&lt;P&gt;When you're in an assembly, trying to set values of iProperties within its sub assemblies or parts, you can't just say "iProperties.Value(SetName, PropName) = oValue".&amp;nbsp; That will just try to put it in the assembly.&amp;nbsp; You would need to either use something like "iProperties.Value(oComponentName, SetName, PropName) =&amp;nbsp; " or "oPropSet.Item("PropName").Value =&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 17:08:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583160#M61965</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T17:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583167#M61966</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would just put it in right where you have MsgBox(oPrice) commented out.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 17:11:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583167#M61966</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T17:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using iLogic to retrieve excel variables (price, cost) based on Part Numbers</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583195#M61967</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I have found another kink to straighten out.&amp;nbsp; It is misleading, but the iProperty you are trying to assign a value to is called "Estimated Cost" within the iProperties dialog box, but its official name is just "Cost" in the iProperties list.&lt;/P&gt;&lt;P&gt;So it's in the "Design Tracking Properties" set, and the PropertyName is "Cost".&lt;/P&gt;&lt;P&gt;The "Cost Center" is as it should be..."Cost Center", though.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 17:21:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-ilogic-to-retrieve-excel-variables-price-cost-based-on/m-p/9583195#M61967</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T17:21:29Z</dc:date>
    </item>
  </channel>
</rss>

