+ Reply to Thread
Results 1 to 6 of 6

PDF Macro Ignores Print Area and File Name

  1. #1
    Registered User
    Join Date
    03-26-2021
    Location
    Fort Worth, TX
    MS-Off Ver
    365
    Posts
    51

    PDF Macro Ignores Print Area and File Name

    Macro I have to save sheets as a pdf has a minor issue. One is it ignores print areas even though I tell it not to and second it adds .xlsm to the end of file names and I don't want it to add anything. Here's the code I have, any reasons why it does this?
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: PDF Macro Ignores Print Area and File Name

    Remove UsedRange if you want to use the PrintArea. The Debug.Print shows the printarea in the Immediate window after a run.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-26-2021
    Location
    Fort Worth, TX
    MS-Off Ver
    365
    Posts
    51

    Re: PDF Macro Ignores Print Area and File Name

    Thanks, print area and name is fixed but for some reason it now saves to my desktop instead of the file path I give it. Any idea why?
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    Re: PDF Macro Ignores Print Area and File Name

    Misread problem.

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: PDF Macro Ignores Print Area and File Name

    I don't see how. You did not include the backslash after FilePath so it tried to save to the root of your c: drive. That errors for me.
    Please Login or Register  to view this content.
    Of course c:\Filepath\ must exist or it will error.

  6. #6
    Registered User
    Join Date
    03-26-2021
    Location
    Fort Worth, TX
    MS-Off Ver
    365
    Posts
    51

    Re: PDF Macro Ignores Print Area and File Name

    The backslash was the issue, File path was just a place holder for the forms. Thanks

+ 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. Replies: 6
    Last Post: 05-22-2018, 11:25 AM
  2. Dynamic Print Area that ignores blank cells containing formulas
    By ms.mount in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 07-03-2017, 05:46 PM
  3. [SOLVED] Modify a macro that creates PDF file from the print area on a worksheet!
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2017, 12:54 PM
  4. [SOLVED] Save selected print area as a pdf file using the text from a specific cells as the file na
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2015, 04:14 PM
  5. Macro - Set Print Area for Changing Data Area
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-27-2013, 04:19 AM
  6. Replies: 1
    Last Post: 01-12-2012, 05:49 AM
  7. [SOLVED] Pivot Table macro to set print area and print details of drill down data
    By Steve Haskins in forum Excel General
    Replies: 2
    Last Post: 12-28-2005, 01:10 PM

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