【问题标题】:OleAutoObj is not opening Excel application in my PCOleAutoObj 没有在我的电脑中打开 Excel 应用程序
【发布时间】:2020-10-20 03:38:08
【问题描述】:

遵循 dxl 代码未在我的 PC 中打开 Excel 应用程序。我怀疑我运行的早期 dxl 脚本。它激活了 Excel Ole Objects 并打开了它们。如何关闭由早期 dxl 脚本打开的所有 excel 进程? 任何帮助将不胜感激。

OleAutoObj objExcel = oleCreateAutoObject("Excel.Application")
if (objExcel != null){
bool excelVisible
oleGet(objExcel, "Visible", excelVisible)
if (excelVisible == false){
olePut(objExcel, "Visible", true)
}
}

-Ashok Anumula

【问题讨论】:

    标签: excel ole ibm-doors


    【解决方案1】:

    有烫发oleCloseAutoObject( objExcel )

    【讨论】:

    • 我试过 oleCloseAutoObject。仍然 dxl 没有打开 Excel 应用程序-Excel 手动启动-从 DOORS 导出 Excel 工作-我可以使用以下代码从 WORD VBA 打开 Excel.Application: Sub exop() Dim excelApp As Excel.Application Dim openExcel As Workbook Set excelApp = New Excel.Application Set openExcel = excelApp.Workbooks.Open("C:\Ashok\file.xlsx") excelApp.Visible = True End Sub 请让我知道如何检查以下内容。 “在 Windows 注册表中注册到 Excel.Application 对象的可执行文件的路径是否正确?”
    • 好吧,如果您询问 Excel 是否安装正确,您可以打开 PowerShell 并执行两个命令 $a=New-Object -ComObject Excel.Applicationecho $a。当您说“未打开 excel 应用程序”时,您的意思是 objExcel 为空还是无法使 Excel 可见?你当然可以用system "powershell -command 'Get-Process Excel | Stop-Process'"这样的命令杀死所有进程“excel.exe”,如果这对你有帮助的话。
    • objExcel 不为空。 Excel 无法显示。
    • 我使用 powershell 杀死了 Excel 进程。但是没有用。仍然不可见 Excel 应用程序。 objExcel 不为空。 Excel 无法显示。 olePut(objExcel, "Visible", true) 行不工作。 Mike,如果您有 DOORS dxl,请检查问题中提到的代码是否在您的 PC 中打开 Excel 应用程序。
    • 它适用于我,但似乎 OLE 自动化对象已绑定到脚本。因此,要真正看到 Excel 是可见的,您可能需要添加 sleep_ 10000 作为最后一行,以便 Excel 在您的屏幕上弹出。脚本完成后,对象再次自动销毁
    猜你喜欢
    • 2020-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多