General discussion


Programmatically reference an ActiveX dll

By SanKulPune ·
I have been searching for the solution but without success.

Can I programatically make a reference to an ActiveX dll as an alternative to manually doing

Project > reference.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Erm from what ?

by Tony Hopkinson In reply to Programmatically referenc ...
Collapse -

Re. Erm from what

by SanKulPune In reply to Erm from what ?
Collapse -


by Slayer_ In reply to Re. Erm from what

<strong>set oObj = CreateObject("Class.object")</strong>

Dim oXML as Object
Set oXML = CreateObject("Microsoft.XMLDOM")</strong>

Creates a DOM object.

When you are done using the object, set its reference to nothing

<strong>Set oXML = Nothing</strong>

This will free up the memory

Also, watch yourself on objects. An created object is considered "empty". If you set an object to nothing, it is not empty, but it IS nothing.

Put simply, this code will runtime error if your object was not created.

<strong>If Not Is Nothing Then</strong> 'Check if object has not been created

So a trick I have learned when dealing with objects in VB6 and especially VBScript, is to actually set all your object variables to "nothing" before you even use them. That way they are always non "empty".

Related Discussions

Related Forums