+ 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
    320

    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 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)

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

    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
    320

    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 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
    320

    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 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
    320
    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

X vBulletin 4.1.8 Debug Information

  • Page Generation 0.07869 seconds
  • Memory Usage 9,087KB
  • Queries Executed 15 (?)
More Information
Template Usage (35):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (4)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (8)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (4)navbar_noticebit
  • (6)option
  • (8)postbit_legacy
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (4)showthread_bookmarksite
  • (7)showthread_similarthreadbit
  • (1)showthread_similarthreads
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper
  • (1)vbseo_linkbackmenu_entry 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (39):
  • ./vbseo.php
  • ./env.php
  • ./vbseo/includes/functions_vbseo.php
  • ./vbseo/includes/functions_vbseo_pre.php
  • ./vbseo/includes/functions_vbseo_url.php
  • ./vbseo/includes/functions_vbseo_createurl.php
  • ./vbseo/includes/functions_vbseo_db.php
  • ./vbseo/includes/functions_vbseo_vb.php
  • ./vbseo/includes/functions_vbseo_seo.php
  • ./vbseo/includes/functions_vbseo_misc.php
  • ./vbseo/includes/functions_vbseo_crr.php
  • ./vbseo/includes/functions_vbseo_cache.php
  • ./vbseo/includes/functions_vbseo_hook.php
  • ./vbseo/includes/functions_vbseo_startup.php
  • ./includes/config.php
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/functions.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/functions_cforum.php
  • ./includes/functions_facebook.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (48):
  • init_startup
  • friendlyurl_resolve_class
  • database_pre_fetch_array
  • database_post_fetch_array
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • fetch_musername
  • cache_templates
  • template_register_var
  • parse_templates
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • reputation_image
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • showthread_similarthread_query
  • showthread_similarthreadbit
  • forumrules
  • showthread_bookmarkbit
  • navbits
  • navbits_complete
  • showthread_complete


Search Engine Friendly URLs by vBSEO 3.6.0 RC 1