That is the beauty of COM scripting your JMP application from outside of JMP.
One can mix and match and tie PC apps together. Just as one can script JMP from Perl/TCL/Python/etc. One can also script Word, Excel, PowerPoint, etc as well.
Best,
-Matt
<-
#!c:\Perl\bin\perl.exe
use Win32::OLE;
# http://support.microsoft.com/kb/214797
print "#######################################################","\n";
# get already active Excel application or open new session
# Start JMP and make it visible
my $jmp = Win32::OLE->new('JMP.Application');
$jmp->{Visible} = 1;
# __ Open existing data table
my $doc = $jmp->OpenDocument("C:\\temp\\Big class.jmp");
$jmp->{Visible}=1;
#__ the classic
my $dt = $jmp->NewDataTable("Hello World.jmp");
my $col = $dt->NewColumn(Col1, 1, 0, 8);
#__ You must add rows before populating the table with data
$dt->AddRows(20, 0);
#__ Set Cell values to increments of 1
for (my $i=1; $i<=20; $i+=1)
{
$col->SetCellVal($i, $i);
}
my $col2 = $dt->NewColumn(Col2, 1, 0, 8);
for (my $i=1; $i<=20; $i+=1)
{
$col2->SetCellVal($i,$i + 5);
}
my $col3 =$dt->NewColumn(Col3, 1, 0, 8);
$col3->AddFormula("Col1 + Col2");
$dt->{Visible} = 1;
# return those JMP calculated values back to perl
my $x = $col3->GetDataVector;
# Start Excel and make it visible
my $xlApp = Win32::OLE->new('Excel.Application');
$xlApp->{Visible} = 1;
# Create a new workbook
my $xlBook = $xlApp->Workbooks->Add;
# Write all the data at once...
my $rng = $xlBook->ActiveSheet->Range("A1:C7");
$rng->{Value} = $x;
->