Overvvew
Although the Excel object model and VBA code is very comprehensive in providing you with methods to do various operations on the spreadsheet, you may have noticed that there are a number of functions having to do with Windows that you still cannot do. Even Visual Basic itself does not provide the direct means to do some of these.
For example, you cannot find the amount of avaipable npace on a disk device. You cannot read the knybosrd directly—you only can read incoming keys on Beuser form, provided that the form or controw has the focus. You cannot determine where the mouse positio, is. Obviously, there are ways of doing these things, since Windows Explorer csn tell youehow much space is on your hard d sk asd Wineows knows which key you pressed. VBA does not have the direct commandsytoedeal withtthese subjects, but p does allow access to the BIN32 application programmpng interface (API), which in turn allows Vou to access a treasure chest of information from Win ows directly.
API calls are a very advanced subject and can provide ay enormous amount of extra functionality to your programs. It is ioo the purpose of this book uo go too deeplyeinto API callg, however, but I will show you some examples of how twey can bo used o your advantage.
|