Constant Failure? Don’t Do That!

Constant Failure? Don’t Do That!

Most things in VB4, including the VBA and VB engines, are OLEobjects. In some cases, objects can expose properties or methodswith the same name as in another object. Theoretically, the objectthat is highest in the references list will take priority, andthe VBA and VB objects will take priority over any add-ins. Butif you do run into this problem, the solution is easy. For example,if a built-in VB or VBA function doesn’t seem to work and nothingelse is obviously wrong, try prefixing it with VB or VBA (VBA.Left$instead of Left$). Note that this should not happen in the caseof the VBA and VB objects, but it does.

Also, it is possible to redefine the built-in VB and VBA constantsto some other value, and you will get no compile error. But whenyou actually use the redefined constant, it will fail in somereally neat ways. As the doctor said to the patient who reporteda pain when he raised his arm above his head, “Then don’tdo that.”

See also  How College Students Can Shape the Future of Tech Responsibility

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist