Results 1 to 4 of 4
  1. #1
    Kristy is offline Novice
    Windows 10 Access 2003
    Join Date
    Jan 2021
    Posts
    7

    Sending XLS object from Access

    Hi, I have created a workbook and now I would like to have access attach the workbook in an email. I can execute it when it's sending a query but I can seem to find anything that will send an excel workbook. Here is the code for the query.

    DoCmd.SendObject acSendQuery, "PCF Automated Agency Checklist Report", acFormatXLS, "kristy@gmail.com", , , "Agency Checklist", "Attached is the report you requested", True

    The report I need to send is located in this file path

    "C:\Users\kristy\Documents\PCF Report.xls"



    can someone help me replace the code for the query with the code for the Excel workbook?

    Thanks in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    SendObject will only send an existing Access object (table, query, etc). You can use Outlook automation to send an attachment with a path. Here's some info:

    https://support.microsoft.com/en-us/...e-using-access

    You can probably use CDO if you don't use Outlook.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Kristy is offline Novice
    Windows 10 Access 2003
    Join Date
    Jan 2021
    Posts
    7
    Thank you Paul. This is what I thought when only those options popped up in the code automation. But I was willing to give it a try and see if it was possible!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 05-23-2019, 07:18 AM
  2. Replies: 5
    Last Post: 04-29-2019, 03:16 AM
  3. Replies: 4
    Last Post: 06-27-2015, 07:01 PM
  4. Combining 'sending mail' with 'sending a report'.
    By Mattbro in forum Programming
    Replies: 2
    Last Post: 11-25-2012, 07:42 AM
  5. Replies: 1
    Last Post: 09-03-2011, 07:01 PM

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
  •  
Other Forums: Microsoft Office Forums