+ Reply to Thread
Results 1 to 5 of 5

Convert to email macro enabled spreadsheets to pdf format by using macro codes

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Convert to email macro enabled spreadsheets to pdf format by using macro codes

    Hello everybody,

    I had a question on macro codes in excel last week and one of the members from the forum answered me with a code that hit the nail on the head! I am very grateful.
    I do, however, have a new question with the same code that was provided to me. The code's main focus is to convert the existing macro enabled worksheet to a regular excel (xlsx) file with no macros whatsoever. This helps me for most of the emails I send to my clients so they can open the spreadsheet with out them ever knowing that it originated from macros.
    Now here is my goal, when I send invoices to clients I want the spreadsheet to be converted automatically to pdf format. You might ask me "so why don't you switch every word in the code that reads 'xlsx' to 'pdf' and the xlsm (macro enabled spreadsheet) will be converted to pdf format?" I will answer to you that I've tried it and the code does attach the file to the email in pdf format but the problem lies when you try to open it - a window appears that says "file is damaged or corrupted and cannot be opened...."
    My personal tale on the matter is that pdf is sensing macros and a sort of confusion happens when a macro enabled spreadsheet is converted to pdf, however, a regular excel spreadsheet which cannot hold any macros can easily be converted to pdf. I would think then that a code that work for this problem would have to first convert the macro enabled spreadsheet to regular excel format (as seen on the below code) and then to pdf this way the pdf file is not reading any "special codes".
    If anyone can shed some light on this matter it would be greatly appreciated!

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Convert to email macro enabled spreadsheets to pdf format by using macro codes

    hi,
    try this
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Convert to email macro enabled spreadsheets to pdf format by using macro codes

    Worked perfect John! Thank you for your help :-)
    Best regards.

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Convert to email macro enabled spreadsheets to pdf format by using macro codes

    You're welcome! glad it works for you!

  5. #5
    Registered User
    Join Date
    03-21-2019
    Location
    NY
    MS-Off Ver
    12
    Posts
    7

    Re: Convert to email macro enabled spreadsheets to pdf format by using macro codes

    Thanks! bvsdgbsdvdsvsd

+ 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. [SOLVED] Send via email macro enabled wrksheet (xlsm) as regular wrksheet (xlsx) using a macro code
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2013, 09:26 PM
  2. convert all 97-2003 excel documents to macro enabled documents on server
    By viperisback in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2013, 09:06 AM
  3. Replies: 0
    Last Post: 08-07-2012, 02:19 PM
  4. Custom File Name At Start-up Using Macro-Enabled Template Format (.XLTM) (VBA)
    By engineerchange in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2012, 08:48 AM
  5. Macro to format future spreadsheets
    By MCONWAY in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2012, 08:31 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