Results 1 to 7 of 7

Thread: Reference Libraries

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    4

    Reference Libraries

    Hi,

    I'm developing an Add-In for microsoft office that will potentially
    be used by many people. The Add-in needs to be compatible across
    many versions of Microsoft Office products e.g. Office 97 onwards
    (Although if it has to be office 2000 that is not so bad). It also
    uses Word, Excel and Powerpoint.

    I'm grapling with how to include Reference libraries, e.g. I know
    how to manually include them in projects e.g. from the project
    references choose the appropriate library e.g. "Microsoft Excel 11
    Object Library", "Microsoft Access 8.0 Object Library" etc, etc.

    I have developed the Add-in to work with the Office 97 reference
    files, therefore it should be compatible (even if outdated) with
    later versions of these files.

    My first question is; If I compile the Add in with the latest
    version of the reference files e.g. "Microsoft Excel 11 Object
    library" (Office 2003), will that be backward compatible with
    someone who has Excel '97 "Microsoft Excel 8.0 Object Library" on
    their pc,

    or

    do I need to compile a separate version of the software for every
    possible combination of office software that could be used on an end
    users pc. aaaaahhhh!, please tell me this is not an option....

    or

    is there a way I can dynamically assign a reference library at
    install time....


    Any help would be appreciated, even point me in the direction of a
    good book (I've searched for plenty, but can't seem to find
    much).... maybe something on relaxation (attempted humour).....

    Thanks in advance.
    Peter Lilley

  2. #2
    New Member
    Join Date
    May 2006
    Location
    NC
    Posts
    4

    Re: Reference Libraries

    Anyone? Anyone?

    I need the smae sort of thing anwered.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Reference Libraries

    You need to use Late Binding. You can not set a reference to any other the versions.

    For ex...

    VB Code:
    1. 'Add a reference to MS Excel xx.0 Object library
    2.  
    3. Private Sub Command1_Click()
    4.     dim oApp As Excel.Application
    5.     Set oApp = New Excel.Application
    6.     oApp.Visible = True
    7. End Sub
    8.  
    9. 'Late Binding:
    10. 'Do NOT add any references to any Office apps.
    11.  
    12. Private Sub Command1_Click()
    13.     Dim oApp As Object
    14.     Set oApp = CreateObject("Excel.Application")
    15.     oApp.Visible = True
    16. End Sub
    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!
    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, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    New Member
    Join Date
    May 2006
    Location
    NC
    Posts
    4

    Re: Reference Libraries

    Thanks Guys. I took the short cut. I put my VB code on a machine that had VB and EXCEL 97 made the link and compiled the code. This is not a distributable program but rather a one of a kind application that will only have to run on this one PC.

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Reference Libraries

    Yup, that will work too.
    Just another way to skin a cat.
    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!
    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, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    4

    Re: Reference Libraries

    Thanks RobDog888 & GrilleGuy, I know I posted this way back in Feb (on multiple forums) and still didn't have an answer.

    Much appreciated....

  7. #7
    New Member
    Join Date
    May 2006
    Location
    NC
    Posts
    4

    Re: Reference Libraries

    All Kudos go to RobDog888

Posting Permissions

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



Click Here to Expand Forum to Full Width