使用 VBA 运行外部程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18639774/
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 23:10:19  来源:igfitidea点击:

Run external program with VBA

apiexcel-vbavbaexcel

提问by G Kelly

I am trying to write Excel VBA code to open an external windows program and then open a file within that external program. I've figured out how to open the program using the "Shell" command but I don't know how to use any of the programs functions once its opened. This is what I have so far. Thanks!

我正在尝试编写 Excel VBA 代码来打开一个外部 Windows 程序,然后在该外部程序中打开一个文件。我已经想出了如何使用“Shell”命令打开程序,但我不知道打开程序后如何使用任何程序功能。这是我到目前为止。谢谢!

Program = "C:\Program Files\EP-Quick\EP-Quick.exe"
TaskID = Shell(Program, 1)

回答by Gary's Student

First review SendKeys in VBA help and:

首先查看 VBA 帮助中的 SendKeys 并:

http://msdn.microsoft.com/en-us/library/gg278655(v=office.14).aspx

http://msdn.microsoft.com/en-us/library/gg278655(v=office.14).aspx

Then, using Google, try to find examples specific to your application

然后,使用 Google,尝试查找特定于您的应用程序的示例