问题
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