+ Reply to Thread
Results 1 to 2 of 2

Mac office, print area save as PDF, name PDF by cell value

Hybrid View

  1. #1
    Registered User
    Join Date
    09-14-2011
    Location
    London
    MS-Off Ver
    Mac Office 2011
    Posts
    62

    Mac office, print area save as PDF, name PDF by cell value

    I'm using mac office and I recorded this macro.
    I use it to select the area and then print but select the save as PDF.

    What I can't see in this code is where does it save it to??
    And how can I save it by the value of D2 as its file name?

    Many Thanks

    Matt

    Sub PrintObject()
    '
    ' PrintObject Macro
    '
    
    '
        Range("A1:E44").Select
        With ActiveSheet.PageSetup
            .PrintTitleRows = ""
            .PrintTitleColumns = ""
        End With
        ActiveSheet.PageSetup.PrintArea = "$A$1:$D$44"
        With ActiveSheet.PageSetup
            .LeftHeader = ""
            .CenterHeader = ""
            .RightHeader = ""
            .LeftFooter = ""
            .CenterFooter = ""
            .RightFooter = ""
            .LeftMargin = Application.InchesToPoints(0.5)
            .RightMargin = Application.InchesToPoints(0.5)
            .TopMargin = Application.InchesToPoints(0.5)
            .BottomMargin = Application.InchesToPoints(0.5)
            .HeaderMargin = Application.InchesToPoints(0.5)
            .FooterMargin = Application.InchesToPoints(0.5)
            .PrintHeadings = False
            .PrintGridlines = False
            .PrintComments = xlPrintNoComments
            .PrintQuality = -4
            .CenterHorizontally = True
            .CenterVertically = False
            .Orientation = xlPortrait
            .Draft = False
            .PaperSize = xlPaperA4
            .FirstPageNumber = xlAutomatic
            .Order = xlDownThenOver
            .BlackAndWhite = False
            .Zoom = False
            .FitToPagesWide = 1
            .FitToPagesTall = 1
        End With
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
        ActiveWindow.SelectedSheets.PrintOut Copies:=1
    End Sub

  2. #2
    Registered User
    Join Date
    09-14-2011
    Location
    London
    MS-Off Ver
    Mac Office 2011
    Posts
    62

    Re: Mac office, print area save as PDF, name PDF by cell value

    I found this http://www.ozgrid.com/forum/showthread.php?t=169852

    and this seams to help

    Sub SavePDFMacro()
         
         
         
        ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=MacScript("return (path to documents folder) as string") & Range("D2").Value, Quality:= _
        xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
        OpenAfterPublish:=True
    
    End Sub
    Having said that it cuts off the edge of the frame, need to make it fit the page somehow
    Last edited by thequiff; 10-25-2013 at 01:48 PM.

+ 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. Print area and save to pdf
    By saniamarco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 05:39 PM
  2. Replies: 1
    Last Post: 02-12-2013, 12:16 PM
  3. Loop, Save Print Area as Published Webpage to Folder
    By mh104916 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2012, 01:32 PM
  4. Replies: 8
    Last Post: 05-23-2007, 06:39 AM
  5. [SOLVED] How do I get excel 98 to save my set print area?
    By jlpdesign in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-18-2005, 10:06 AM

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