请帮我制作这段代码。我想使用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
没有编译器错误,但是当我执行宏时,它什么也没做......我还有其他替代方法吗?请帮助我,谢谢!
答案 0 :(得分:4)
如果您只想启动该程序,请尝试使用
Sub open_test()
Dim sFullPathToExecutable as String
sFullPathToExecutable = "C:\test.exe"
Shell sFullPathToExecutable
End Sub