+ Reply to Thread
Results 1 to 6 of 6

Print to PDF problem

Hybrid View

  1. #1
    Registered User
    Join Date
    11-07-2015
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    91

    Print to PDF problem

    Hi all, I have a macro to print to PDF. Problem I am having is when I run it, it changes my margins and prints across multiple pages instead of the margins I set. Here is the code I am using:

    Sub Export_to_pdf()
        ChDir "/Users/name/Desktop/"
        ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
            "/Users/name/Desktop/" & Cells(1, 1).Value, Quality:=xlQualityStandard, _
            IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
            True
    End Sub
    Is there anything I can add or change so this doesn't happen?

    Thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,703

    Re: Print to PDF problem

    The issue is not in your code. Is it possible for you to share the file?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-07-2015
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    91

    Re: Print to PDF problem

    Sure here is my file

  4. #4
    Registered User
    Join Date
    11-07-2015
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    91

    Re: Print to PDF problem

    Sorry was having a problem attaching it. Here it is
    Attached Files Attached Files

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,703

    Re: Print to PDF problem

    The PDF file I get (attached) is exactly the same as the page layout as shown in the file. The first page is the calendar and the second page is just a gray box. It is using the margins exactly as set.

    What is it you are expecting this to look like? If you do a Print Preview you will see exactly what it will look like in the PDF file.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-07-2015
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    91

    Re: Print to PDF problem

    Yes that's what it should look like but when I do it from my workbook which it changes it and prints it over 4-5 different pages, could it be related to other sheets on my excel file? I ended up taking out a lot of the merged cells, made the text smaller and made the dates shorter in length and now it works. Thanks for your help

+ 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 to set print range, open box asking for print qty, print, then redefine print area
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2012, 06:43 PM
  2. Excel 2007 : Print Problem
    By mbesspiata in forum Excel General
    Replies: 2
    Last Post: 09-16-2011, 09:15 AM
  3. VBA print problem
    By Aquila in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2010, 08:34 AM
  4. print problem
    By John Ploughman in forum Excel General
    Replies: 1
    Last Post: 09-24-2009, 01:47 PM
  5. Print problem
    By codyaaron2 in forum Excel General
    Replies: 1
    Last Post: 04-17-2009, 02:41 PM
  6. Print problem
    By WhiteKelso in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2007, 01:34 PM
  7. Print or Print Area problem.
    By icetrey in forum Excel General
    Replies: 2
    Last Post: 03-19-2007, 02:35 AM
  8. Replies: 4
    Last Post: 02-17-2006, 08:36 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