MS Access Missing References-VBForums
Results 1 to 4 of 4

Thread: MS Access Missing References

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    46

    MS Access Missing References

    I'm a C#.Net developer and haven't done VBA in a long time, so forgive my ignorance.

    I have an Access 365 app from a client and I'm trying to work on it off site. I have Office 2013. When I open the app I get the error "Can't find project or library" on this line:

    Code:
    Dim appOutlook As Outlook.Application
    If I uncheck the missing references won't this break the code once it's back at the client site? Again , they're referencing Office 365.

    In the references list I'm missing:
    • Microsoft Office Outlook 16.0 Object Library
      Microsoft ActiveX Data Objects 2.0
      Microsoft Office Excel 15.0 Object Library
      Microsoft Office 15.0 Object Library


    1) If I remove these references, won't that break things back on the the client's site?
    2) How do you normally handle a situation like this?

    Thank you

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,489

    Re: MS Access Missing References

    Welcome to the Forums.

    This is what happens when you use Early Binding and lock your application in to a particular version of another application. If you remove the references yes it will break.

    Usually if you have to support multiple versions of, Outlook for example, you would use Late Binding and use only the features that are common to all the needed supported versions.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    46

    Re: MS Access Missing References

    Quote Originally Posted by RobDog888 View Post
    Welcome to the Forums.

    This is what happens when you use Early Binding and lock your application in to a particular version of another application. If you remove the references yes it will break.

    Usually if you have to support multiple versions of, Outlook for example, you would use Late Binding and use only the features that are common to all the needed supported versions.

    I understand and completely agree.

    I'm just getting started, so I don't yet know what functionality is required from each reference. If they're referencing Outlook just to send an email, that can be accomplished with most Outlook references. Same for reading/writing from Excel.

    Sounds like there needs to be code that check for a specific version of each DLL.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    23,034

    Re: MS Access Missing References

    that can be accomplished with most Outlook references
    yes but if you change the reference version to run on your machine, it will not run on theirs when you take it back, you can not change the reference back except on a machine with the required version installed


    to use late binding
    remove all references to office applications

    Dim appOutlook As Outlook.Application
    change all msoffice type variables to type object

    replace all instances like set appOutlook = new outlook with set appoutlook = createobject("outlook.application") appropriate to the application required

    make sure all office constants are declared or use their literal values, else they may default to 0

    see the thread at the top of this forum for the tutorial on automating office applications

    the project should then run on your machine and still run when you take it back
    there maybe some lines the may fail, on your machine, as they use properties or methods, only valid in later versions, not much you can do about those in your earlier versions

    the only other option, that i would hate to recommend, is to upgrade your office to a later version
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.