<?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: goExcel.FindRow gives result of -1 in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8966489#M100458</link>
    <description>&lt;P&gt;here is the Part file I am testing this with. (it will become the base template for developing conveyors when done)&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2019 18:36:44 GMT</pubDate>
    <dc:creator>asmenut</dc:creator>
    <dc:date>2019-08-14T18:36:44Z</dc:date>
    <item>
      <title>goExcel.FindRow gives result of -1</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8966484#M100457</link>
      <description>&lt;P&gt;I am trying to access multiple columns data on a single row that is "flagged" by a specific value (i.e. 1650).&lt;/P&gt;&lt;P&gt;The following code sets a parameter value "BSeries" to object Series_val and then I use goExcel.FindRow to locate the row that "BSeries" value is.&amp;nbsp; But when I run the code, the messagebox shows a result of -1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a form that I am using to populate parameters, based on the BSeries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GoExcel.Open("C:\Users\jpetty\Documents\John's Scratch\bfd\Belt Data.xlsx", "Belt_Data")&lt;/P&gt;&lt;P&gt;Series_val = Parameter.Value("BSeries")&lt;BR /&gt;MessageBox.Show(Series_val)&lt;BR /&gt;&lt;BR /&gt;j = GoExcel.FindRow("C:\Users\jpetty\Documents\John's Scratch\bfd\Belt Data.xlsx", "Belt_Data", "SERIES", "=", Series_val)&lt;BR /&gt;'b = GoExcel.CurrentRowValue("SERIES")&lt;BR /&gt;MessageBox.Show(j)&lt;BR /&gt;'MessageBox.Show(Parameter("BSeries"))&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 18:33:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8966484#M100457</guid>
      <dc:creator>asmenut</dc:creator>
      <dc:date>2019-08-14T18:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: goExcel.FindRow gives result of -1</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8966489#M100458</link>
      <description>&lt;P&gt;here is the Part file I am testing this with. (it will become the base template for developing conveyors when done)&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 18:36:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8966489#M100458</guid>
      <dc:creator>asmenut</dc:creator>
      <dc:date>2019-08-14T18:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: goExcel.FindRow gives result of -1</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8967450#M100461</link>
      <description>&lt;P&gt;Hi, many times this type of access to the Excel file has given me headaches. I take more time trying to find the error than accessing otherwise.&lt;BR /&gt;Below I show you a way to access an excel file.&lt;BR /&gt;If you find the value you are looking for in a row you can identify a value from the same row.&lt;BR /&gt;In order for this to work correctly and load all the values correctly, I would recommend that you load all the values in the "Series" column that are blank, because otherwise you will not take these comparison values because their value is "nothing".&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oValue&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"100"&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Dirxlsx&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"C:\Users\Sergio\Downloads\Belt Data.xlsx"&lt;/SPAN&gt;    &lt;SPAN&gt;'''&lt;/SPAN&gt;&lt;SPAN&gt; Specify the template path&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;"Belt_Data"&lt;/SPAN&gt;           &lt;SPAN&gt;'''&lt;/SPAN&gt;&lt;SPAN&gt; Specify the sheet of the template&lt;/SPAN&gt;

&lt;SPAN&gt;xlApp&lt;/SPAN&gt; = &lt;SPAN&gt;CreateObject&lt;/SPAN&gt;(&lt;SPAN&gt;"Excel.Application"&lt;/SPAN&gt;)
&lt;SPAN&gt;xlApp&lt;/SPAN&gt;.&lt;SPAN&gt;Visible&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;
&lt;SPAN&gt;xlWorkbook&lt;/SPAN&gt; = &lt;SPAN&gt;xlApp&lt;/SPAN&gt;.&lt;SPAN&gt;Workbooks&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;(&lt;SPAN&gt;Dirxlsx&lt;/SPAN&gt;,&lt;SPAN&gt;False&lt;/SPAN&gt;)
&lt;SPAN&gt;xlWorksheet&lt;/SPAN&gt; = &lt;SPAN&gt;xlWorkbook&lt;/SPAN&gt;.&lt;SPAN&gt;Worksheets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;osheet&lt;/SPAN&gt;)

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;row&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt;=2 &lt;SPAN&gt;To&lt;/SPAN&gt; 147

	&lt;SPAN&gt;oSeries&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CellValue&lt;/SPAN&gt;(&lt;SPAN&gt;Dirxlsx&lt;/SPAN&gt;, &lt;SPAN&gt;osheet&lt;/SPAN&gt;, &lt;SPAN&gt;"B"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;row&lt;/SPAN&gt;)
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oSeries&lt;/SPAN&gt; = &lt;SPAN&gt;oValue&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;oStyle&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CellValue&lt;/SPAN&gt;(&lt;SPAN&gt;Dirxlsx&lt;/SPAN&gt;, &lt;SPAN&gt;osheet&lt;/SPAN&gt;, &lt;SPAN&gt;"C"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;row&lt;/SPAN&gt;)
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;oStyle&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;SPAN&gt;xlWorkbook&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt; (&lt;SPAN&gt;True&lt;/SPAN&gt;)
&lt;SPAN&gt;xlApp&lt;/SPAN&gt;.&lt;SPAN&gt;Quit&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I hope this helps with your problem. regards&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 09:39:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8967450#M100461</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-08-15T09:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: goExcel.FindRow gives result of -1</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8968405#M100465</link>
      <description>&lt;P&gt;don't ask me why but it has to do with the empty cells in your series column, it probably treats the first blank cell as the end of the search range, I just filled in the empty cells with 'x's and it worked as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 17:21:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/goexcel-findrow-gives-result-of-1/m-p/8968405#M100465</guid>
      <dc:creator>omartin</dc:creator>
      <dc:date>2019-08-15T17:21:12Z</dc:date>
    </item>
  </channel>
</rss>

