I suspect that you are running the script against the wrong data table.
I opened the Excel table you attached, and then clicked on the "Enable Editing" button to permit changing of the table.
I then clicked on the JMP Addin button in Excel and then clicked on the Data Table icon to have Excel create the spreadsheet to a JMP data table.
I then copied the script I wrote from the Community Discussion page, Changed all of the references to "40" to "41".
Next I added in ":c41" to the Cell Plot/
Finally, I ran the script and got the count data table
and the Cell Plot output
The only think I can think of that is causing the issue that you are seeing is that the data table with all 41 columns is not the current "Active Data Table" when you are running the script.
Here is the JSL, with the references pointing to 41 columns.
Names Default to Here( 1 );
dt = Current Data Table();
dtCounts = New Table( "Counts", add rows( 41 ) );
dtCounts << delete columns( :column 1 );
For( i = 1, i <= 41, i++,
dtCounts << New Column( "c" || Char( i ), set each value( . ) )
);
For( i = 1, i <= 41, i++,
For( k = i, k <= 41, k++,
theCount = Length( dt << get rows where( As Column( dt, i ) == 1 & As Column( dt, k ) == 1 ) );
dtCounts[i, k] = theCount;
dtCounts[k, i] = theCount;
)
);
dtCounts << New Column( "The Columns", character, set each value( "c" || Char( Row() ) ) );
dtCounts << move selected columns( :The Columns, to first );
dtCounts << Cell Plot(
Scale Uniformly( 1 ),
Center at zero( 0 ),
Y(
:c1, :c2, :c3, :c4, :c5, :c6, :c7, :c8, :c9, :c10, :c11, :c12, :c13, :c14, :c15, :c16, :c17, :c18,
:c19, :c20, :c21, :c22, :c23, :c24, :c25, :c26, :c27, :c28, :c29, :c30, :c31, :c32, :c33, :c34, :c35,
:c36, :c37, :c38, :c39, :c40, c41
),
Label( :The Columns ),
Legend( 1 ),
SendToReport(
Dispatch( {}, "Cell Plot Report", FrameBox, {Frame Size( 79, 23 )} ),
Dispatch( {}, "", Lineup Box( 2 ), {Spacing( 1 )} )
)
);
Jim