Solved DLL Can't add a reference to the specified file (1 Viewer)

Saphirah

Active member
Local time
Today, 19:58
Joined
Apr 5, 2020
Messages
163
Hello everyone,

i am trying to use Amazon AWS WebService in MS Access.
Amazon does not include official VBA support, but they provides a precompiled DLL for various different .Net Versions.

My experience with DLL's in Access is limited to say the least.
Amazon provides DLL's for .Net v.3.5, 4.5, 3.1 and 2.0.
I tried to embed every DLL in MS Access using the References Window, but every time Access threw an error saying: "Can't add a reference to the specified file".

By browsing various online forums i found out that this might be due to the DLL not being compiled as an ActiveX, but a C++ library, so it can not be loaded by access.
Is there a possibility to make such a DLL work in MS Access? Or is there another reason for the error?

I know there is also the possibility to Declare the functions of the DLL by hand, but this is not an option, since one needs to access the DLL's classes.
And to my knowledge you can not import classes using Declare.

So, thank you very much for your help everyone :)
 

Saphirah

Active member
Local time
Today, 19:58
Joined
Apr 5, 2020
Messages
163
Okay after a lot of back and forth i managed to fix the issue.
I created a custom DLL using C#.
Basically i imported the AWS Module in a C# Class Library, wrote a custom function that fits my needs, compiled it and registered it as COM Interop.

Then i simply imported the dll in access. Usually i write my full solutions here in the forum, but these were just too many steps.
Sorry for that :)
 

Users who are viewing this thread

Top Bottom