cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
lwx228
Level VIII

How to run jsl script in excel VBA?

My JMP installation path is "c:\00\jmp\jmp.exe".


I need to start jMP.exe in a VBA and have "jMP.exe" run the "c:\abc.jsl" file.

I wrote VBA like this.The JMP program can be started, but JSL is not running.

Sub test()

    Shell "c:\00\jmp\jmp.exe ""c:\abc.jsl"""

End Sub

2020-06-29_17-50.png

16 REPLIES 16
nascif_jmp
Level VI

Re: How to run jsl script in excel VBA?

Can you share with us what abc.jsl is trying to do? There are many ways of integrating JMP with Excel. Perhaps there is a better way to accomplish your task than running JMP as a subroutine.

 
Georg
Level VII

Re: How to run jsl script in excel VBA?

I agree to @nascif_jmp , as a platform switch Always is a Chance to have Trouble.

 

Why also not Performing the whole Job in jmp?

By the way, the Shell call for a jmp Job works as simple as follows:

 

Path2JMP\jmp.exe script.jsl

and if the script starts with "//!", it is excecuted on Opening,

and you can quit at the end.

See Scripting guide --> getting started (or search for //!)

 

//!
Names Default To Here( 1 );
// here Comes the JMP Job ...
Quit();

 

Georg
lwx228
Level VIII

Re: How to run jsl script in excel VBA?

Yes, I've converted most of what I do with VBA to JSL.
Prepare to spend some more time modifying the remaining VBA to JSL as well.

Thanks!
lwx228
Level VIII

Re: How to run jsl script in excel VBA?

The focus of the question is:

Inexplicable errors occur when q programs use CSV files generated in JMP.

However, open the CSV file in Excel and save it once, so that the CSV file can be calculated at q level normally.

nascif_jmp
Level VI

Re: How to run jsl script in excel VBA?

@lwx228 another thing to consider: it looks like the main feature of the q application is the ability to run SQL queries against CSV files.

But did you know that JMP also has a similar feature?

Take a look at the Query Builder, which supports building queries against tables since JMP13. This presentation is a good starting point. Query Builder for Tables: A "No Tears" Way for Newcomers to Relate to the Relational Model 

 

QUOTA_BYTES quota exceeded
lwx228
Level VIII

Re: How to run jsl script in excel VBA?

Yes, JMP is a great piece of software.
But I'm not using Q for that.
Q is surprisingly fast.


So the point is how to use jMP-generated CSV files without this problem.

 

Thanks!

lwx228
Level VIII

Re: How to run jsl script in excel VBA?

If open the CSV generated by JMP with Note.exe, it will see these scrambled codes,

2020-06-29_22-26.png

 

This CSV file is opened in Excel, and then saved as a CSV file. This new CSV file is opened and displayed in Note.exe is normal.

2020-06-29_22-27.png

lwx228
Level VIII

Re: How to run jsl script in excel VBA?

I used JSL saved as CSV file is:.

 

d3 << Save( "C:/123.csv" );
Georg
Level VII

Re: How to run jsl script in excel VBA?

What are your Export Settings?

Looks like there is a Special character used as delimiter for columns, that is not shown properly in "note.exe".

Have a look at File --> preferences --> Text data files --> Export settings

 

Does the example under Scripting index for Big Class ("Save as") work properly?

Georg