Stumbled across another question VBA A point in space is def

Stumbled across another question... VBA

A point in space is defined in a VBA program as an object called 3dObject, which has three attributes, x_coord, y_coord and z_coord. Illustrate how such an object could be defined programmatically in VBA and show how each property is set and retrieved.

Solution

Answer :

Objects In The VBA Extensibility Model

The following is a list of the more common objects that are used in the VBA Extensibilty object model. This is not a comprehensive list, but will be sufficient for the tasks at hand.

VBIDE
The VBIDE is the object library that defines all the objects and values that make up VBProject and the Visual Basic Editor. You must reference this library to use the VBA Extensibility objects. To add this reference, open the VBA editor, open your VBProject in the editor, and go to the Tools menu. There, choose References . In the References dialog, scroll down to Microsoft Visual Basic for Applications Extensibility 5.3 and check that item in the list. You can add the reference programmatically with code like:

VBE
The VBE refers to the Visual Basic Editor, which includes all the windows and projects that make up the editor.

VBProject
A VBProject contains all the code modules and components of a single workbook. One workbook has exactly one VBProject. The VBProject is made up of 1 or more VBComponent objects.

VBComponent
A VBComponent is one object within the VBProject. A VBComponent is a regular code module, a UserForm, a class module, any one of the Sheet modules, or the ThisWorkbook module (together, the Sheet modules and the ThisWorkbook module are called Document Type modules). A VBComponent is of one of the following types, identified by the Type property. The following constants are used to identify the Type. The numeric value of each constant is shown in parentheses.


CodeModule
A CodeModule is the VBA source code of a VBComponent. You use the CodeModule object to access the code associated with a VBComponent. AVBComponent has exactly one CodeModule which contains all the code for that component.

CodePane
A CodePane is an open editing window of a CodeModule. When you are typing code, you are entering code into the CodePane.

Referencing VBIDE Objects

The code below illustrate various ways to reference Extensibility objects.

In the code and descriptions on this page, the term Procedure means a Sub, Function, Property Get, Property Let, orProperty Set procedure. The Extensibility library defines four procedures types, identified by the following constants. The numeric value of each constant is shown within parentheses.

The rest of this page describes various procedures that modify the various objects of a VBProject.

Stumbled across another question... VBA A point in space is defined in a VBA program as an object called 3dObject, which has three attributes, x_coord, y_coord

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site