Forum Discussion

  • Philip West's avatar
    Philip West
    Steel Contributor

    Try this in place of your code. You might need to check the paths to make sure they are correct.

     

    I've told it to name the pdf document whatever is in the B21 (ie the family name, but again you should be able to change that if that's not what you wanted. If you hard code the file name though you will saving over the top of the same document every time.

     

    Private Sub CommandButton2_Click()
    file_name = Sheets("progression chart").Range("B21")
    Sheets("Progression chart").Range("A1:K74").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        "\\Proliant1\psl\Data Feedback\PDF File\" & file_name & ".pdf", Quality:= _
        xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
        OpenAfterPublish:=True
    End Sub

     

Resources