【问题标题】:Minitab closes automatically with Excel macrosMinitab 使用 Excel 宏自动关闭
【发布时间】:2023-03-18 18:59:01
【问题描述】:

我想运行宏来对单独存储的 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

【问题讨论】:

    标签: excel vba minitab


    【解决方案1】:

    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
    

    【讨论】:

    • 如果您添加一些解释性文字,它将使此答案对其他人更有用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-11
    • 2017-12-18
    • 2020-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多