I am attempting to reference the MoleZip dll (COM/ActiveX component to zip and extract) from a Microsoft Access 02 module. I have been able to create a reference to the dll using this visual basic for applications code:

Function AddReference() As Boolean
Dim ref As Reference, strFile As String
strFile = "C:\Windows\System32\MoleZip.dll"
Set ref = References.AddFromFile(strFile)
AddReference = True
End Function

Even though this creates a MoleZip entry in the references list and object browser, it doesn't seem to create an entry in the windows registry, and the MoleZip functions (zip/unzip) do not work. However, if I manually add the reference using the reference dialog box (and browse button) from the tools menu in VBA, it does create windows registry entries for MoleZip and the MoleZip functions then work fine. I thought the code example above was supposed to do the same thing as manually adding the reference like I have described, but one works and the other doesn't.

Can anyone give me some insight into why this is happening or what I might be doing wrong?

Byron Tedder