Other Methods of Controlling Applications

Although you can pass commands to another program by using the SendKeys statement, you must resort to other methods to gain full control of another application. There are two standard ways in which applications can communicate with one another. The newest method, known as Automation, allows you to access and manipulate the objects of another application. Through Automation, you can write VBA procedures that control other applications by referencing another application's objects, properties, and methods. In the remaining sections of this chapter, you will learn how to control another application via Automation. The old data-exchange technology called DDE (Dynamic Data Exchange) is a protocol that allows you to dynamically send data between two programs by creating a special channel for sending and receiving information. DDE is quite slow and difficult to work with. DDE should be used only if you need to communicate with an older application that does not support Automation.

0 0

Post a comment