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
toby_roche0
Level I

Automating JMP with c# and visual studio.

I'm trying to run an instance of jmp from a c# program but i'm having trouble adding the reference to Visual studio.

The reference is not included in the drop down menu as described in the documentation, and I am unable to add JMP.TLB manually.

Visual studio tells me that the reference is either not accessible or it is an invalid assemble or com component.

Has anyone else come across this issue?

12 REPLIES 12

Re: Automating JMP with c# and visual studio.

Hi Toby,

 

Much of the C# documentation is old, and references an older Visual Studio in the hope that it will reach as many people and as many different versions as possible.  I tried adding a reference to Visual Studio 2013 in a C# project, and was successful.  In general, you would do "Project->Add Reference..." and do a COM reference.  However, VS 2013 seems to be malfunctioning there.  Instead, I would bring up the Solution Explorer (attached image Step 1) and right click on "References" and do "Add Reference...".  Now, rather than say Assemblies or COM, select Browse.  Browse to the JMP.TLB file in c:\program files\sas\jmp\13 (directory may be different for 32-bit build or JMP Pro) and select the file.  The reference should be added.  I build a simple Windows Forms test case with this reference and JMP came up.  The code I used was:

 

 

public partial class Form1 : Form
{
  JMP.Application myJMP;
  {
    public Form1()
  }
  private void Form1_Load(object sender, EventArgs e)
  {
    myJMP = new JMP.Application();
    myJMP.Visible = true;
  }

 

 

I hope this helps.

 

Brian Corcoran

JMP Developmen

Step 1Step 1

Step 2Step 2

toby_roche0
Level I

Re: Automating JMP with c# and visual studio.

Thanks for your reply.

unfortunately I already tried the method described on visual studio 2015 with jmp 11.2.1.

I also tried it on a different machine and i still get an error saying that jmp.tlb is either not accessible or not a valid com assembly.

Re: Automating JMP with c# and visual studio.

Are you an Administrator on the machine in question?  Do you have copy/write access?

Brian

m_shaheen
Level I

Re: Automating JMP with c# and visual studio.

I have the same problem and I am logged on to my machine as an admin!

uday_guntupalli
Level VIII

Re: Automating JMP with c# and visual studio.

@briancorcoran
          Is there an updated documentation page that shows how a user can initiate JMP using C# ? Kindly share

Best
Uday

Re: Automating JMP with c# and visual studio.

Uday,

With the product comes the Automation Reference and automation samples. You can find each:

  • Automation Reference: C:\Program Files\SAS\JMPPRO\13\Documentation\Automation Reference.pdf
  • Samples: C:\Program Files\SAS\JMPPRO\13\Samples\Automation\
Wendy
Benkins
Level II

Re: Automating JMP with c# and visual studio.

It's not clear whether this issue was resolved?   I am having similar problems as the OP with jmp.tlb, I have tried to reference it for each C++, C# and VB following the respective automation reference instructions, and the procedure starting from the solution explorer listed in the replies. 

(i.e. all cases lead the error window: "A reference to 'C:\Program Files\SAS\JMP\14\jmp.tlb' could not be added.  Please makes sure that the file is accessible, and that it is a valid assembly or COM component")

I am using Visual Studio 2017 + JMP14, are others still having this problem? 

 

Re: Automating JMP with c# and visual studio.

I was able to reference the V14 type library with Visual Studio 2017 without issue in C#.  I used Project->Add Reference and then browsed to the type library in c:\program files\sas\jmp\14.  Please note that if  you have multiple versions of JMP installed, automation will start the last one installed regardless of which type library you reference.

 

I'm including a ZIP file of a VS 2017 project to just start/quit JMP.

 

Brian Corcoran

JMP Development

 

Re: Automating JMP with c# and visual studio.

I would also make sure you haven't created your project in a read-only directory, like in program files somewhere.  Referencing the type library causes Visual Studio to emit a new file with the class/interface definitions for JMP Automation.  If it cannot write out that file, it will fail.

 

Brian Corcoran

JMP Development