VBA Automation or Using other applications Libraries

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

If you use the objects in other applications as part of your Visual Basic application, you may want to establish a reference to the object libraries of those applications. This Documentation provides a list, sources and examples of how to use libraries of different softwares, like Windows Shell, Internet Explorer, XML HttpRequest, and others.

Syntax

  • expression.CreateObject(ObjectName)
  • expression; Required. An expression that returns an Application object.
  • ObjectName; Required String. The class name of the object to create. For information about valid class names, see OLE Programmatic Identifiers.

Remarks

When an application supports Automation, the objects the application exposes can be accessed by Visual Basic. Use Visual Basic to manipulate these objects by invoking methods on the object or by getting and setting the object's properties.

If you use the objects in other applications as part of your Visual Basic application, you may want to establish a reference to the object libraries of those applications. Before you can do that, you must first be sure that the application provides an object library.

Allows you to select another application's objects that you want available in your code by setting a reference to that application's object library.

Creates an Automation object of the specified class. If the application is already running, CreateObject will create a new instance.



Got any VBA Question?