OpenProcess给出“Sub或Function not defined”错误

时间:2010-12-02 14:41:36

标签: vba excel-vba excel

我在Excel中使用VBA并且正在尝试使用流行的ShellAndWait子例程。在这个子中是对OpenProcess的调用,但这给了我一个编译错误“Sub或Function not defined。”我试图研究为什么会出现这种情况并且找不到任何东西。我需要在VBA中设置一个特定的参考资料来使用它吗?我没有这台机器的管理员权限 - 这可能是个问题吗?感谢您的任何见解。

1 个答案:

答案 0 :(得分:2)

您是否已声明OpenProcess?

Declare Function OpenProcess Lib “kernel32” (ByVal dwDesiredAcess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long 
相关问题