打开外部 EXE.使用 VBA Powerpoint 文件 [英] Open an external EXE. file using VBA Powerpoint

查看:79
本文介绍了打开外部 EXE.使用 VBA Powerpoint 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我使此代码有效.我想使用 Powerpoint VBA 打开外部 EXE 文件.

Please help me make this code works. I want to open an external EXE file using Powerpoint VBA.

Sub open_test()
Dim FileName, FSO, MyFile
FileName = "C:\test.exe"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = FSO.OpenTextFile(FileName, 1)
End Sub

没有编译器错误,但是当我执行宏时,它什么也没做...我有这个代码的另一种选择吗?请帮助我,谢谢

There are no compiler errors, but when i execute the macro, it does nothing ... I have another alternatives to this code? please help me, thanks!

推荐答案

如果你只是想启动程序,试试用

If you just want to start the program, try using

Sub open_test()
    Dim sFullPathToExecutable as String
    sFullPathToExecutable = "C:\test.exe"
    Shell sFullPathToExecutable 
End Sub

这篇关于打开外部 EXE.使用 VBA Powerpoint 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆