+ Reply to Thread
Results 1 to 6 of 6

VBA References - Microsoft Outlook 14.0 Object Library - load with macro

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    Bolton
    MS-Off Ver
    Excel 2010, Access 2010
    Posts
    3

    VBA References - Microsoft Outlook 14.0 Object Library - load with macro

    I've had a look around at some other threads. In essence, this is my setup:

    Microsoft Access 2010, Excel 2010, Outlook 2010.

    On Access close:
    Export query to: C:\file.xls
    Open excel object and import module
    call module
    close excel
    kill file.xls

    Basically, when the database closes I want it to automatically do some stuff I'm fine with all this, works well. The issue comes here:

    Included in running the macro on the xls file is to generate and send an email. Easily done, just tick the appropriate reference for microsoft outlook 14.0 object library. Works a treat.

    This issue is that the minute I close excel and try to run the macro, this reference is unticked. No idea why it doesnt save. I've tried some code to load this reference but it hasnt worked.

    Any suggestions welcome.

    Thanks

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Why is Excel involved?

    Couldn't you just have the code to send the email in Access?

    As for the reference not being checked, are you working with an existing Excel workbook?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-18-2013
    Location
    Bolton
    MS-Off Ver
    Excel 2010, Access 2010
    Posts
    3

    Re: VBA References - Microsoft Outlook 14.0 Object Library - load with macro

    I "mess around with it" to make it a nicer format before attaching the file to the email and sending it.

    I'm not as familar with access, I dont doubt it could be done. I can make it so the workbook is an existing workbook and access just calls the macro within that. My only issue then is how to export the query to that workbook, without replacing it.

    I had been using the Access Macro rather than access VBA for that.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA References - Microsoft Outlook 14.0 Object Library - load with macro

    you could just set up an external data query in the excel workbook and run everything from there
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    How about doing everything in Excel?

  6. #6
    Registered User
    Join Date
    01-18-2013
    Location
    Bolton
    MS-Off Ver
    Excel 2010, Access 2010
    Posts
    3

    Re: VBA References - Microsoft Outlook 14.0 Object Library - load with macro

    Quote Originally Posted by JosephP View Post
    you could just set up an external data query in the excel workbook and run everything from there

    Quote Originally Posted by Norie View Post
    How about doing everything in Excel?
    *facepalm* You know when the answer is staring you in the face, but you need a fresh pair of eyes to point it out.

    Thanks both, I'll do a link into excel.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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