+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    03-16-2009
    Location
    SN3 4TN
    MS-Off Ver
    Office 2007/2003
    Posts
    6

    Save to specific location as cell name

    Hi all,

    I've been searching for ages trying to work out how to do this but have so far only managed to confuse myself.
    I have office 2007 and I have found some code to convert an excel sheet to PDF, however I need it to saveas the contents of cell (e6) and save to a location on our network drives (C:\TEMP\).

    Code:
    Sub Macro1()
    '
    ' Macro1 Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+L
    '
    Sheets(Array("Report")).Select
    Sheets("Report").Activate
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "C:\TEMP\Book1.pdf", Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
    True
    End Sub
    Your help will be most appreciated.
    Last edited by Jabba; 10-15-2009 at 07:06 AM. Reason: SOLVED

  2. #2
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    XL2003 / 2007
    Posts
    2,448

    Re: Save to specific location as cell name

    Hi,

    Try this:

    Code:
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            "C:\temp\" & Range("E6").Value, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
            IgnorePrintAreas:=False, OpenAfterPublish:=True
    Sarcasm - because beating the **** out of someone is illegal.

  3. #3
    Registered User
    Join Date
    03-16-2009
    Location
    SN3 4TN
    MS-Off Ver
    Office 2007/2003
    Posts
    6

    Re: Save to specific location as cell name

    Thanks Dave, that worked perfectly.

  4. #4
    Registered User
    Join Date
    06-19-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro to Save File as PDF based on Cell Contents

    Sub pdfsave()

    pdfname = Range("P4").Value

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfname, Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
    True
    End Sub

  5. #5
    Registered User
    Join Date
    06-19-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro to Save File as PDF based on Cell Content to specific folder

    I am looking for a macro to saved to a specific folder on my computer as a PDF file (c:\My Documents/PDF) and automatically named based on cell content. Excel 2007

    This coding below works, but I want to add that it automatically saves to a specific folder on my computer.

    Is it possible to save to PDF and .xls in the same macro?

    Sub pdfsave()

    pdfname = Range("P4").Value

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfname, Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
    True
    End Sub

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0