Windows API examples

Before you can use a Windows API function, you must declare the function at the top of your code module. If the code module is for a UserForm, Sheet, or ThisWorkbook, you must declare the API function as Private.

An API function must be declared precisely. The declaration statement tells VBA:

■ Which API function you're using

■ In which library the API function is located

■ The API function's arguments

After you declare an API function, you can use it in your VBA code.

0 0

Post a comment