<?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 JMP - Excel VBA Automation in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34420#M20385</link>
    <description>&lt;P&gt;Hi, I am using JMP automation to get particular row number based on the selected data using "SelectRowsWhere" function, but I could not get the row number value is there any other way to get the row number. see below my code.&lt;/P&gt;&lt;P&gt;Sub getrownum()&lt;BR /&gt;&amp;nbsp; Dim MyJMP As JMP.Application&lt;BR /&gt;&amp;nbsp; Dim JMPDoc As JMP.Document&lt;BR /&gt;&amp;nbsp; Dim DT As JMP.DataTable&lt;BR /&gt;&amp;nbsp; Set MyJMP = CreateObject("JMP.Application")&lt;BR /&gt;&amp;nbsp; Set JMPDoc = MyJMP.OpenDocument("D:\JMP Main Data Table\TestData.jmp")&lt;BR /&gt;&amp;nbsp; MyJMP.Visible = True&lt;BR /&gt;&amp;nbsp; Set DT = JMPDoc.GetDataTable&lt;BR /&gt;&amp;nbsp; Set col1 = JMPDoc.GetDataTable.GetColumn("Date")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;'DT.SelectRows 102056, 102057&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'to get the row number 102065 ??&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DT.SelectRowsWhere "Date", rowSelectEquals, rowSelectClearPrevious, "3565986300"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;noofrowselected = DT.GetNumberOfRowsByRowState(rowStateSelected)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;nn = DT.EnumRowStatesBegin(rowStateSelected)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;n1selectedrow = DT.EnumRowStatesGetNextRow()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;n2selectedrow = DT.EnumRowStatesGetRowByIndex(1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;getronumff = n1selectedrow&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;- Bala&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2017 16:43:11 GMT</pubDate>
    <dc:creator>Bala</dc:creator>
    <dc:date>2017-01-12T16:43:11Z</dc:date>
    <item>
      <title>JMP - Excel VBA Automation</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34420#M20385</link>
      <description>&lt;P&gt;Hi, I am using JMP automation to get particular row number based on the selected data using "SelectRowsWhere" function, but I could not get the row number value is there any other way to get the row number. see below my code.&lt;/P&gt;&lt;P&gt;Sub getrownum()&lt;BR /&gt;&amp;nbsp; Dim MyJMP As JMP.Application&lt;BR /&gt;&amp;nbsp; Dim JMPDoc As JMP.Document&lt;BR /&gt;&amp;nbsp; Dim DT As JMP.DataTable&lt;BR /&gt;&amp;nbsp; Set MyJMP = CreateObject("JMP.Application")&lt;BR /&gt;&amp;nbsp; Set JMPDoc = MyJMP.OpenDocument("D:\JMP Main Data Table\TestData.jmp")&lt;BR /&gt;&amp;nbsp; MyJMP.Visible = True&lt;BR /&gt;&amp;nbsp; Set DT = JMPDoc.GetDataTable&lt;BR /&gt;&amp;nbsp; Set col1 = JMPDoc.GetDataTable.GetColumn("Date")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;'DT.SelectRows 102056, 102057&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'to get the row number 102065 ??&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DT.SelectRowsWhere "Date", rowSelectEquals, rowSelectClearPrevious, "3565986300"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;noofrowselected = DT.GetNumberOfRowsByRowState(rowStateSelected)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;nn = DT.EnumRowStatesBegin(rowStateSelected)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;n1selectedrow = DT.EnumRowStatesGetNextRow()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;n2selectedrow = DT.EnumRowStatesGetRowByIndex(1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;getronumff = n1selectedrow&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;- Bala&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 16:43:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34420#M20385</guid>
      <dc:creator>Bala</dc:creator>
      <dc:date>2017-01-12T16:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: JMP - Excel VBA Automation</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34451#M20394</link>
      <description>&lt;P&gt;Hi Bala,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would look at the&amp;nbsp;"Data Table .NET" sample program that ships with JMP. &amp;nbsp;For JMP 13, this would be under C:\program files\sas\jmp\13\Samples\Automation\Visual Basic Samples. &amp;nbsp;There are a couple ways to do this. &amp;nbsp;One, which you were getting at, is the Enum. &amp;nbsp;The sample contains a button called Enum Selected that does what you want. &amp;nbsp;The relevant code is:&lt;BR /&gt;&lt;BR /&gt; NSelected = DT.EnumRowStatesBegin(JMP.rowStateConstants.rowStateSelected)&lt;BR /&gt; For i = 1 To NSelected&lt;BR /&gt; MsgBox(DT.EnumRowStatesGetNextRow, MsgBoxStyle.OkOnly, "Next Selected Row Is")&lt;BR /&gt; Next i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also look at the "Get Selected Vector" example. &amp;nbsp;This uses the call GetRowStateVector to return an array of all the selected rows by index. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "Get Selected Data", another example, uses GetRowStateVectorData to return the underlying data values rather than the indices.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian Corcoran&lt;/P&gt;
&lt;P&gt;JMP Development&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 20:48:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34451#M20394</guid>
      <dc:creator>briancorcoran</dc:creator>
      <dc:date>2017-01-12T20:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: JMP - Excel VBA Automation</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34452#M20395</link>
      <description>&lt;P&gt;I should also mention that if you want individual column values, then you should obtain a column object from the data table object, and then just call GetCellVal on that.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;For instance:&lt;BR /&gt;&lt;BR /&gt;Col = DT.GetColumn("age")&lt;/P&gt;
&lt;P&gt;val = Col.GetCellVal(index)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 20:52:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34452#M20395</guid>
      <dc:creator>briancorcoran</dc:creator>
      <dc:date>2017-01-12T20:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: JMP - Excel VBA Automation</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34465#M20402</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Brian Corcoran,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for the reply, yes I am using the "Data Table .NET" as sample. Previously the problem is I could not get the Row index (row number) value using the "SelectRowsWhere", that could be due to the value type. Now I changed the code to following and it solves the purpose.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;' &amp;nbsp; **DT.SelectRowsWhere "Date", rowSelectEquals, rowSelectClearPrevious, "3565986300"**&lt;BR /&gt;&amp;nbsp; &amp;nbsp;DT.SelectRowsWhere "Date", rowSelectEquals, rowSelectClearPrevious, "12-31-2016 12:00:00 AM"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;noofrowselected = DT.GetNumberOfRowsByRowState(rowStateSelected)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;nn = DT.EnumRowStatesBegin(rowStateSelected)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;n1selectedrow = DT.EnumRowStatesGetNextRow()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;n2selectedrow = DT.EnumRowStatesGetRowByIndex(1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;getronumff = n1selectedrow&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 01:26:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Excel-VBA-Automation/m-p/34465#M20402</guid>
      <dc:creator>Bala</dc:creator>
      <dc:date>2017-01-13T01:26:17Z</dc:date>
    </item>
  </channel>
</rss>

