+ Reply to Thread
Results 1 to 3 of 3

Macro for Exporting to PDF makes file too large

  1. #1
    Registered User
    Join Date
    07-13-2016
    Location
    Redcliff
    MS-Off Ver
    MS Office 2016
    Posts
    6

    Question Macro for Exporting to PDF makes file too large

    Hello everyone. I'm new to the forum. I have a real head scratcher here and I'm hoping I can get some help. I have an excel document which some staff use and they occasionally export the content of the spreadsheet to PDF. This seems to have been working fine until the introduction of Office 2016. On office 2013 and earlier the data would export to a PDF which would be about 6 MB. The guys would then send this PDF in an email to whoever needs it. Now with office 2016 the same data exported to PDF is over 40 MB in size, too large for an email attachment. Is there a way to bring this file size down some? I already tried setting the quality to minimum in the macro but it made little difference. Below is the macro code.

    Sub PDFWorkbook()

    Dim strPDFName As String

    strPDFName = Worksheets("Input Page").Range("txtFileName").Value


    Sheets(Array("Cover", "TOC", "Summary", "#1", "#2", "#3", "#4", "#5", "#6", "#7", "#8", "#9", "#10", "#11", "#12", "#13", "#14", "#15", "#16", "#17", "#18", "ALL", "CHEM", "WB1", "WB2")).Select

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "C:\Random Location\PDF\" & strPDFName & ".pdf", Quality:= _
    xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=True

    Sheets("Input Page").Select

    End Sub

    Any help to bring this file size down will be appreciated. Going back to a previous version of office is less than desirable and also impractical. Thanks.

  2. #2
    Registered User
    Join Date
    07-02-2016
    Location
    Vernon BC
    MS-Off Ver
    2013
    Posts
    17

    Re: Macro for Exporting to PDF makes file too large

    Interesting problem, I am no help but would like to know if there is any cure ?

  3. #3
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,677

    Re: Macro for Exporting to PDF makes file too large

    How many pages is the resulting PDF? Are there a lot of blank pages?
    Entia non sunt multiplicanda sine necessitate

+ 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 Importing Text File makes the file longer to load everytime
    By Hudas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-15-2014, 11:26 AM
  2. Macro to import large CSV file with condition
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-18-2012, 02:01 AM
  3. Editing makes file slower
    By footloose in forum Excel General
    Replies: 4
    Last Post: 04-05-2012, 01:11 AM
  4. Excel file referencing a large central macro file?
    By alanzero in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2011, 08:29 PM
  5. Macro scripts to calculate cell value and exporting file format type
    By pban92 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 02-26-2010, 06:24 AM
  6. [SOLVED] Error in large file import macro
    By Scott Calkins via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-30-2005, 08:05 AM

Tags for this Thread

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