0

我想运行宏来对单独存储的 excel 文件执行功能。我创建了一个 minitab 宏文件并将其保存为 .MAC 格式。当我运行excel宏代码打开minitab代码时,它运行mac代码并自动关闭

    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
4

1 回答 1

0

子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
于 2021-05-14T05:46:35.607 回答