Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference to VB6 dll in VBA

Status
Not open for further replies.

bartrein

Programmer
Sep 22, 2008
49
EU
Do i need to reload (remove and add reference) to my dll file every time i compile it ? I am getting an error if i don't do it - something like "class does not support automation"

thanks
 
Huh?

This is the VBA forum, so please start off with:

What application are you asking about?
You are compiling a DLL in an application????? What exactly are you compiling?

I think you are asking about changes you are making in your DLL - previously compiled I assume.

Some more information re: the classes you are using in your DLL would be helpful.

Simply put, not enough information to give any meaningful answer.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Hi Fumei

Let's start again :)

application - excel 2003
dll library written/compiled in VB6
classes (?)- standard class modules i guess (i'm not using any of the on_connection methods as it's an automation addin not com)
reference added in VB editor in Excel

after changing and recompiling existing dll i always need to untick it in references and tick again to make it work.

is it standard behaviour?

thanks
 
I'm guessing the dll is an ActiveX dll compiled in vb6; if so;

>Do i need to reload (remove and add reference) to my dll file in my VBA Project every time i compile the dll?

Yes unless you (understand) and tick Binary Compatibility via the Vb6 IDE - Project menu - YourProj Properties Option - Component tab.

The following link may help you to understand
I hope ths will help, if not and this is a vb6 issue please repost in forum222.
 
Unless of course you use Late Binding (see CreateObject rather than New) to the Objects in the dll in your VBA Project; that way no Project Reference is required in the VBA Project and it will not be sensitive to a specific version of the dll.
 
Thanks a lot Hugh - CreateObject is something i haven't thought about. Still I will explore Binary Compatibility link

Many thanks
 
CreateObject or not there is some advantage in getting the Binary Compatibilty concept understood otherwise a new entry is made in the Window Registry every time you re-compile the ActiveX. At the end of such re-compiles VB6 is good enough to automatically reregister the new ActiveX, however unless you have manually unregistered the existing version first (eg via a Regsvr32 my ax.dll /u on the command line) its details can remain stranded in the registry. This is of no immediate consequence but adds to trash in the registry of the host machine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top