Controlling Minitab by vba (visual basic) or vb

I

Inspector-71

Is it possible to control minitab from another application e.g. access or excel using visual basic or vba.

my specific example is I have an access database which exports a query to excel and produces an individuals chart. i would like to do this in mintab if possible.

working between VBA applications i would use something like

Code:
Dim oExcel As Excel.Application
Dim oChart As Excel.Chart
Set oExcel = Excel.Application
oExcel.Workbooks.Open "/gg.xls"
oExcel.Visible = False
   
With oExcel
.
.
.
End with

could I do somethign similar with mintab and access it's command line?

Thanks for any help.
 

Miner

Forum Moderator
Leader
Admin
Re: Controlling minitab by vba or vb

The short answer is yes. I have seen it done from Excel by a former coworker. Unfortunately, I do not know how he did it.

Allattar is a Cover with knowledge of Minitab macros. Hopefully, he will be able to assist you.
 

reynald

Quite Involved in Discussions
Is it possible to control minitab from another application e.g. access or excel using visual basic or vba.

my specific example is I have an access database which exports a query to excel and produces an individuals chart. i would like to do this in mintab if possible.

working between VBA applications i would use something like

With oExcel


could I do somethign similar with mintab and access it's command line?

Thanks for any help.

Hi,
How about directly accessing your database from minitab? Once i made a executable file that made my minitab connect to MS Access to download data, and then produce reports that i need on a regular basis.

Im not good in macros, all i did was to go to
FILE>>QUERY DATABASE
then go with the instructions.
After that i saved the session history as exec file.
Here is a sample code
Code:
ODBC;
  Connect "DSN=MS Access Database;DBQ=C:\Documents and Settings\rfrancisco\De" &
  "sktop\HDPD DB rev02.mdb;DefaultDir=C:\Documents and Settings\rfrancisco\De" &
  "sktop;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin" &
  ";";
  SQLString "SELECT `Data`,`ID` FROM `MSysAccessObjects`".
 
A

Allattar

The simple answer is yes, but its a bit long.

Basically you need to start Minitab in excel.
Global MTBEXCELapp as mtb.application
should start Minitab
Sub auto_open()
Set MTBEXCELapp = new mtb.application

(inside this sub you can put commands for creating a menu bar)
end sub

The trick here is to send info from excel into Minitab, you need a subcommand to send data to Minitab.
Then use a form to select the range of data you are sending across.

Problem here is I half understand this, and half ripped the code off an example :) which works for me, but it does some odd things at times, like generating lots of menu items.

If you really want the example I have I will need to sense check it a little remove a few things, but I can try and put a simple example up.

If you ask Minitab tech support they should be able to help with an example.
There is also a visual basic project hidden in the Minitab install directory, its in a folder called mymenu, and contains a dll with the project.

Placing the dll into the addin directory in Minitab creates a new menu in Minitab with a couple of examples
 
K

KuoFaye

Hi,

Is it possible to deliver data (in Excel) to Minitab and then get a regression formula?
Then turn this formula back to Excel.

All the processes are controlled by VBA.
Is there any connection between MinitabAddinTLb commands?

Or Allattar has some examples could share?

Thanks for any help.
 
A

Allattar

The Addintlb commands are commands to add dialogue boxes to Minitab. Before you get excited I think it only works in VB6.

you want to look for the MTB Type library commands. Put those in the references.

The Help in Minitab, look for automation, details the command structure.

You have
MTB
MTB.Application
MTB.application.activeproject etc...

Sending a command to Minitab for instance would be
mtb.application.activeproject.executecommand "Minitab command string"

Where the Minitab command string is the macro language/ session window language in Minitab. When you run anything from the menus in Minitab it saves the commands in the history folder, and you can pick these up from there. eg: plot c1*c2 creates a scatterplot.

Getting the formula out of a regression in Minitab back into excel...
Never tried that. Getting graphs yes, formula, could be tricky. The regression tools in Minitab allow you to store the coefficients in the worksheet. Perhaps you can use the columns.column object commands to grab the cells of the coefficients.

Let me know if you need more to help you get started. I know thats only a quick post.
 

reynald

Quite Involved in Discussions
Hi,

Is it possible to deliver data (in Excel) to Minitab and then get a regression formula?
Then turn this formula back to Excel.

All the processes are controlled by VBA.
Is there any connection between MinitabAddinTLb commands?

Or Allattar has some examples could share?

Thanks for any help.

Basic question only: Why not use excel's built-in regression capability?
 
Top Bottom