• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro not working in VBA

Belleke

Well-Known Member
Code:
Sub SetPDFTemplate()
    Dim PDFFile     As FileDialog
    Set PDFFile = Application.FileDialog(msoFileDialogFilePicker)
    With PDFFile
        .Title = "Select PDF Form"
        .Filters.Add "PDF Type Files", "*.pdf", 1
        If .Show <> -1 Then GoTo Noselection
        Sheet1.Range("E5").Value = .SelectedItems(1)
    End With
    Noselection:
End Sub
 
Top