Skip to main content
Understanding automation
Automation (formerly OLE Automation) is a feature of the Component Object Model (COM), an industry-standard technology that applications use to expose their […]
Understanding scope and visibility
Scope refers to the availability of a variable, constant, or procedure for use by another procedure. There are three scoping levels: procedure-level, […]
Understanding the lifetime of variables
The time during which a variable retains its value is known as its lifetime. The value of a variable may change over […]
Understanding objects, methods, properties, and events
Objects and collections An object represents an element of an application, such as a worksheet, a cell, a chart, a form, or […]
Understanding conditional compilation
Use conditional compilation to run blocks of code selectively, for example, debugging statements comparing the speed of different approaches to the same […]
Understanding named arguments and optional arguments
When you call a Sub or Function procedure, you can supply arguments positionally, in the order that they appear in the procedure's […]
Using arrays
You can declare an array to work with a set of values of the same data type. An array is a single […]
Using constants
Your code might contain frequently occurring constant values, or might depend on certain numbers that are difficult to remember and have no […]
Using data types efficiently
Unless otherwise specified, undeclared variables are assigned the Variant data type. This data type makes it easy to write programs, but it […]
Using events with the Application object
Before you can use events with the Application object, you must create a class module and declare an object of type Application with events. For […]
Using For Each...Next statements
For Each...Next statements repeat a block of statements for each object in a collection or each element in an array. Visual Basic […]
Using the Add-In Manager
Use the Add-In Manager dialog box to load or unload an add-in. If you close only the visible portions of an add-in—by […]