0

I want to run the macros to perform capability on the excel file stored separately. I created a minitab macro file and saved it in.MAC format. When I run the excel macro code to open the minitab code, it runs the mac code and closes automatically

    Sub GetModel()

    Dim MtbApp As Object

    ActiveWindow.WindowState = xlMinimized
    Set MtbApp = CreateObject("Mtb.Application")
    

    
    MtbApp.Open "C:\Users\gvadivel\Desktop\Gowtham\Project_3_Capability Study\minitabfile\Minitab.MPJ"
           
    MtbApp.ActiveProject.ExecuteCommand "%test2"


    End Sub
Gowtham
  • 1
  • 2

1 Answers1

0

Sub GetModel()

Dim MtbApp As Object

ActiveWindow.WindowState = xlMinimized
Set MtbApp = CreateObject("Mtb.Application")



MtbApp.Open "C:\Users\gvadivel\Desktop\Gowtham\Project_3_Capability Study\minitabfile\Minitab.MPJ"

Set mtbUI = MtbApp.UserInterface
    mtbUI.Visible = True
    mtbUI.Interactive = True
    mtbUI.UserControl = True
    mtbUI.DisplayAlerts = True

MtbApp.ActiveProject.ExecuteCommand "%test2"

End Sub