Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Taken directly from <a href="http://word.mvps.org/fAQs/InterDev/EarlyvsLateBinding.htm" rel="nofollow noreferrer">http://word.mvps.org/fAQs/InterDev/EarlyvsLateBinding.htm</a></p> <blockquote> <p>There are two ways to use Automation (or OLE Automation) to programmatically control another application.</p> <p>Late binding uses CreateObject to create and instance of the application object, which you can then control. For example, to create a new instance of Excel using late binding:</p> <pre><code> Dim oXL As Object Set oXL = CreateObject("Excel.Application") </code></pre> <p>On the other hand, to manipulate an existing instance of Excel (if Excel is already open) you would use GetObject (regardless whether you're using early or late binding):</p> <pre><code> Dim oXL As Object Set oXL = GetObject(, "Excel.Application") </code></pre> <p>To use early binding, you first need to set a reference in your project to the application you want to manipulate. In the VB Editor of any Office application, or in VB itself, you do this by selecting Tools + References, and selecting the application you want from the list (e.g. “Microsoft Excel 8.0 Object Library”).</p> <p>To create a new instance of Excel using early binding:</p> <pre><code> Dim oXL As Excel.Application Set oXL = New Excel.Application </code></pre> <p>In either case, incidentally, you can first try to get an existing instance of Excel, and if that returns an error, you can create a new instance in your error handler.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload