打开外部 EXE。使用 VBA Powerpoint 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12552638/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 17:49:44  来源:igfitidea点击:

Open an external EXE. file using VBA Powerpoint

vbapowerpointpowerpoint-vba

提问by Andrei20193

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

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

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!

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

回答by AardVark71

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