Can I Share a MDE (which only has VBA Code) with other apps?

Discussion in 'Access VBA Modules' started by G, Jun 1, 2010.

  1. G

    G Guest

    I am using Access 2003, and I was thinking of creating a databe with just VBA
    code in modules. There will be functions in there that I would like to
    reference with other applications.

    Is it possible for me to reference some of the functions in the MDE database
    with Excel and use the function I was created in the MDE ???


    G, Jun 1, 2010
    1. Advertisements

  2. If you add a reference to the library db, any other db using
    the same version of Access can use any globally available
    variables, Functions and Subs.
    Marshall Barton, Jun 1, 2010
    1. Advertisements

  3. G

    david Guest

    You can't reference an MDE from Excel

    Unfortunately, the VBA project is stored inside a database in a
    special format known only to Access, and Excel can't get it out.

    The obvious solution would be to move your shared code to
    an ActiveX control built in VB5 or VB6, so that it could be
    shared by Access or Excel. Unfortunately, MS has discontinued
    VB5 and VB6, and there is no replacement product.

    There are some stupid work arounds -- you could rewrite
    as VB Script, then use a VB Script wrapper to get a COM
    object that you could register and use in Excel and Access --
    but that would generally be more work than just re-writing
    and copying the code between Access and Excel.

    For special purposes, you can create an Access Application
    object in Excel VBA, and use Excel VBA to control Access
    to use your MDE code, but that is only when you particularly
    want to use Access, Excel, and your Data at the same time--
    it's not generally a good solution for just sharing code, because
    starting a copy of Access just to use some shared code is
    generally too slow and flaky.

    david, Jun 2, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.