Open an external EXE. file using VBA Powerpoint

谁都会走 提交于 2019-12-23 04:29:00

问题


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!


回答1:


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


来源:https://stackoverflow.com/questions/12552638/open-an-external-exe-file-using-vba-powerpoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!