+ Reply to Thread
Results 1 to 3 of 3

Saving as a PDF file and using a cell name as the file name

Hybrid View

CJ2308 Saving as a PDF file and... 08-11-2015, 11:22 AM
AlphaFrog Re: Saving as a PDF file and... 08-11-2015, 11:50 AM
CJ2308 Re: Saving as a PDF file and... 08-11-2015, 11:57 AM
  1. #1
    Registered User
    Join Date
    07-29-2015
    Location
    South Carolina
    MS-Off Ver
    8
    Posts
    12

    Saving as a PDF file and using a cell name as the file name

    Trying to figure this out, I want to save a a sheet as a PDF file where the value in B22 is the file name.

    If I run this macro as it seems to convert it to a PDF file, but is labeld ISF Form and is not saved.

    Thanks,


    Sub savePDF()
    '
    ' savePDF Macro
    '

    '
    Dim fname As String
    With ActiveSheet
    fname = "C:\Users\USA\Documents\ISF FORMS\" & Range("B22").Value
    .ExportAsFixedFormat Type:=xlTypePDF, Quality:= _
    xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=True
    End With
    End Sub

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Saving as a PDF file and using a cell name as the file name

    Sub savePDF()
    '
    ' savePDF Macro
    '
    ActiveSheet.ExportAsFixedFormat _
        Type:=xlTypePDF, _
        Filename:="C:\Users\USA\Documents\ISF FORMS\" & Range("B22").Value, _
        Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, _
        IgnorePrintAreas:=False, _
        OpenAfterPublish:=True
    End Sub
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-29-2015
    Location
    South Carolina
    MS-Off Ver
    8
    Posts
    12

    Re: Saving as a PDF file and using a cell name as the file name

    Thanks for your help! This worked.

+ 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. [SOLVED] Saving MASTER file, automatically remove part of file name and append current date?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2014, 08:13 AM
  2. Replies: 5
    Last Post: 09-13-2012, 11:50 AM
  3. Problem saving Excel file that copies an embedded object from a separate file
    By bhodge10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-16-2012, 02:47 PM
  4. Creating a .txt file extracting information from a Excel file saving as .resx file
    By AbdallahHajbed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2012, 09:00 AM
  5. [SOLVED] Saving worksheet in new file with date AND cell value as file name
    By michaelberrier in forum Excel General
    Replies: 4
    Last Post: 05-26-2006, 03:10 PM
  6. [SOLVED] Saving multi-tab excel file created from comma delimited text file
    By Marcus Aurelius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2005, 01:20 PM
  7. [SOLVED] saving an excel file as an ASCII text file without delimiters
    By Sewellst in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-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