+ Reply to Thread
Results 1 to 8 of 8

EXCEL to OUTLOOK as attachment

  1. #1
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332

    EXCEL to OUTLOOK as attachment

    I am currently using the code below to export the active sheets from my workbook to Outlook in PDF format. I am looking to change the VBA code so that it does exactly the same thing as it does now with the exception of it being in PDF format. I want it to be in the same format as the current spreadsheet, which is .xlsm or it could even convert it to a regular .xls (the macro function is no longer needed once it is emailed)

    Does anyone know how to update this code so that it will do this for me. I figure it's easy but I'm not sure how to change it.

    Please Login or Register  to view this content.
    Corrected the code boxes... are people allowed to reply now?
    Last edited by Gtrtim112; 06-29-2017 at 12:37 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: EXCEL to OUTLOOK as attachment

    Unfortunately your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332

    Re: EXCEL to OUTLOOK as attachment

    Done with the correction, sir.

    Can people reply now?

  4. #4
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332

    Re: EXCEL to OUTLOOK as attachment

    Never mind - I figured it out myself.

    Please Login or Register  to view this content.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: EXCEL to OUTLOOK as attachment

    Instead of the code that Exports the filename use the File SaveAs syntax to save the file, and change the extension from .pdf to .xlsm or .xls

  6. #6
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332

    Re: EXCEL to OUTLOOK as attachment

    Quote Originally Posted by Richard Buttrey View Post
    Instead of the code that Exports the filename use the File SaveAs syntax to save the file, and change the extension from .pdf to .xlsm or .xls
    Richard,

    Even though I have solved this, your answer has intrigued me. I'm not curious if I'm reading your reply correctly. Is there a way that either of my previous codes above can be altered so that the current .xlsm file would be exported to Outlook as a .xls file?

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: EXCEL to OUTLOOK as attachment

    Quote Originally Posted by Gtrtim112 View Post
    Richard,

    Even though I have solved this, your answer has intrigued me. I'm not curious if I'm reading your reply correctly. Is there a way that either of my previous codes above can be altered so that the current .xlsm file would be exported to Outlook as a .xls file?
    Hi,

    Yes just use the file format number 56. e.g (or 57 if Excel for Mac)

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332
    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Yes just use the file format number 56. e.g (or 57 if Excel for Mac)

    Please Login or Register  to view this content.
    I guess I misread your reply. I see what you mean now. The save as function won't do me any good, unfortunately. This particular workbook is used my multiple people from hundreds of locations. They all get sent to a centralized location, which was why the export function was added. Unless I can have it export and convert this .xlsm to a .xls, I'll have to leave as is. The .xlsm isn't accessible from some mobile devises, which was the reason for me asking about your suggestion.

+ 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. VBA in Outlook to edit Excel Attachment
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2016, 11:11 AM
  2. save excel attachment in outlook message
    By DCRAIG3389 in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 11-07-2015, 04:00 PM
  3. Outlook Attachment To Excel
    By Frankinstyyn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2015, 05:57 AM
  4. Sending Attachment from Excel through Outlook
    By blackscholes in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2014, 11:48 AM
  5. [SOLVED] VBA Macro to print to Pdf format and place as attachment in Outlook (Excel & Outlook 2007)
    By Webman1012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2013, 01:25 PM
  6. Open Outlook Attachment into Excel
    By majosum in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 07:38 PM
  7. excel vba to get the emails with attachment in outlook
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2012, 03:37 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