+ Reply to Thread
Results 1 to 5 of 5

macro for print to PDF active woorkbook

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-11-2012
    Location
    minot, north dakota
    MS-Off Ver
    Excel 2010
    Posts
    127

    macro for print to PDF active woorkbook

    I am looking for help with a macro that will print all active tabs to PDF and keep the same file name and location as current excel file. If any one could help me with this it would be greatly appreciated I keep getting errors when trying to put it together with information I have read on the internet.

  2. #2
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: macro for print to PDF active woorkbook

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Replace(ThisWorkbook.FullName, ".xlsm", ".pdf")
    To do it for me and help me it is 2 different things!
    Sorry for my english, blame Google translator

  3. #3
    Forum Contributor
    Join Date
    09-11-2012
    Location
    minot, north dakota
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: macro for print to PDF active woorkbook

    I need it to work for entire workbook PDF all active tabs (excludes hidden tabs) into one PDF document.

  4. #4
    Forum Contributor
    Join Date
    09-11-2012
    Location
    minot, north dakota
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: macro for print to PDF active woorkbook

    I got it to work thank you changed the activesheet to activeworkbook and it is working like a champ.
    Thank you for all your help its truely appreciated

  5. #5
    Forum Contributor
    Join Date
    09-11-2012
    Location
    minot, north dakota
    MS-Off Ver
    Excel 2010
    Posts
    127

    Re: macro for print to PDF active woorkbook

    One last change is need. How can i add to this to make sure if there is a identical PDF it will ask do you want to replace this file.
    [CODE][/Sub PDFprint()
    '
    ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Replace(ThisWorkbook.FullName, ".xlsm", ".pdf"), OpenAfterPublish:=True
    End Sub
    CODE]

+ 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: 1
    Last Post: 06-13-2015, 03:58 AM
  2. how to make macro button to print page that has the active cell only?
    By meonly123 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-22-2015, 11:05 AM
  3. Macro to Print active sheet as PDF to Active workbook and customize name
    By Scott Taylor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-17-2012, 08:52 PM
  4. Macro leaves chart active - cannot print to pdf
    By gtiguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2012, 04:51 AM
  5. Macro that will copy cells to another area & print active page (not sheet)
    By Cyali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2012, 09:34 PM
  6. Create hyperlink to active woorkbook using macro
    By danpo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2011, 05:27 AM
  7. Macro to Publish Print Area from Active Sheet to Web Page
    By jdinning in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-11-2009, 12:41 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