How to deploy and call .NET-Assembly (DLL) from VBA/Access ?

Last post 02-07-2008, 9:59 AM by Damon. 1 replies.
Sort Posts: Previous Next
  •  02-07-2008, 4:34 AM Post number 43708

    How to deploy and call .NET-Assembly (DLL) from VBA/Access ?

    Hello!

    I've developed a .NET-Assembly (DLL) which now has to be made accessible from a VBA/Access-Application.

    The assembly should be located in the application folder of the application file (.mdb), but not in ms-office folder.

    I know it is possible to set a reference from within VBA to the type library (at build time) when assembly and type library are registered. But here I have to find a way for a general setup routine, which means I have to load / reference the type library or DLL at runtime from within VBA/Access. The assembly is registered on customer pc and the vba-application is installed. So it is not possible to set a reference at build time.

    My question: Is it possible to load type libraries / DLLs dynamically at runtime from VBA/Access?


    Thank you very much.

    Haselnuss
  •  02-07-2008, 9:59 AM Post number 43720 in reply to post number 43708

    • Damon is not online. Last active: 10-06-2008, 7:24 AM Damon
    • Top 10 Contributor
    • Joined on 06-26-2006
    • Dallas, TX
    • Acorn Archimedes

    Re: How to deploy and call .NET-Assembly (DLL) from VBA/Access ?

    You can load assemblies dynamically at runtime using reflection, but all of the calls you make to the assembly will need to be via reflection as well.  If you have a limited number of calls that need to be made on the assembly, then it won't be too tedious. But if you're planning on using the assembly extensively then you may get annoyed at how much reflection code you're going to be writing.

    For more information about reflection, just search for ".NET load assembly with reflection" or something similair and you'll find plenty on it.


    Damon Armstrong, Technology Consultant
    [Blog] [Articles]
View as RSS news feed in XML