+ Reply to Thread
Results 1 to 19 of 19

Question about VBA references - Microsoft Outlook library

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Question about VBA references - Microsoft Outlook library

    Hi Guys,

    i have a program that creates a calendar entry at the end of the macro. I wrote this vba in excel 2013 so the reference in the VBA tools is Microsoft Outlook 15.0 object library. however i now have a problem. all the rest of my team that is using this program is using excel 2010. which uses microsoft outlook 14.0 object library.

    how do i set the reference to be 14.0?

    should i open the code with excel 2010, add the 14.0 library reference, save and then will it automatically upgrade to 15.0 for my 2013 excel?

    thanks in advance

  2. #2
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Question about VBA references - Microsoft Outlook library

    You should have access to the older libraries. If you want highest compatibility you want to use the oldest library since that will cover more versions. Just be mindful that you may have to change the syntax since it may be different depending on the version.

  3. #3
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    i have looked through the references and the ONLY outlook refreence is 15.0

  4. #4
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    ok heres a question - the file gets saved on a server drive and is updated sporadically - if i were to have the file that is updated always have the outlook 14.0 object library ticked in teh references (through using excel2010 to save the VBA code) will it when opened on my computer, update itself to 15.0 automatically?

  5. #5
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Question about VBA references - Microsoft Outlook library

    References don't update on their own.

    Try using late binding to create your outlook. http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    thanks Six -
    so if this is the code....

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Question about VBA references - Microsoft Outlook library

    Replace your variables
    Please Login or Register  to view this content.
    Then remove the reference library.
    Last edited by slx; 03-28-2014 at 02:53 PM.

  8. #8
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    error - variable not defined - highlights sub addtooutlook() in yellow

    and takes the cursor to and highlights
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Question about VBA references - Microsoft Outlook library

    instead, use
    Please Login or Register  to view this content.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Question about VBA references - Microsoft Outlook library

    If you are using late-binding you need to either replace constants, eg olFolderCalendar, with their values or add a declaration for them.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  11. #11
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    sorry i am struggling with the early to late binding - and now i have two answers....im a little confused. i copied yours over six and now the error is object variable with block variable not set and highlights
    Please Login or Register  to view this content.

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Question about VBA references - Microsoft Outlook library

    Sorry for confusing things.

    six has replaced olFolderCalendar which was my first suggestion.

    The code I posted was the code for my second suggestion.

    Both have the same effect.

  13. #13
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    thanks norie - but i do not know where to go with the next error that came up after changing to Six's suggestion. sorry to be such a noob here

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Question about VBA references - Microsoft Outlook library

    Have you checked the calendar name against what's in M6 on the sheet 'fresh thinking audit'?

  15. #15
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    ahh yes i am stupid - had nothing populated. however the last variable that needs to be amde constant is
    Please Login or Register  to view this content.

  16. #16
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Question about VBA references - Microsoft Outlook library

    There's no constant(s) involved in that line of code.

  17. #17
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    ok then maybe this is my newness coming thorugh. here is the full code right now - the bold line is what is eoming up with an error:"object variable or with block variable not set"

    Please Login or Register  to view this content.

  18. #18
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Question about VBA references - Microsoft Outlook library

    This,
    Please Login or Register  to view this content.
    should be this.
    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    03-04-2014
    Location
    calgary, canada
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Question about VBA references - Microsoft Outlook library

    fantastic - thanks to you both for your help!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. macro to fix missing:microsoft outlook 14.0 object library
    By sujithy007 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-13-2021, 09:59 AM
  2. How can I reference Microsoft Outlook 15.0 Object Library?
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-11-2019, 06:25 AM
  3. Excel won't allow me to add reference to Microsoft outlook object library
    By Skyla157 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2013, 07:38 PM
  4. VBA References - Microsoft Outlook 14.0 Object Library - load with macro
    By bltn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2013, 11:28 AM
  5. [SOLVED] Re: Outlook 11 > Outlook 10 Object Library Compatibility Issues
    By DW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2006, 11:35 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1