Results 1 to 11 of 11

Thread: When PrintView button is clicked open the invoice in PDF format

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Nov 2014
    Posts
    6
    Location

    When PrintView button is clicked open the invoice in PDF format

    Dear all

    My attached excel sheet has list of invoices on sheet (invoice) - third sheet , Column B has invoice numbers and Colum E has hyperlinks which are coming from the SQL server, these hyperlinks to open the invoices in WORD format;

    This is the location of the one of the invoice "\\svr-storage3\Accounts_Data\Docs\H\H\A\HHA6\62\Bill ref 223615_458254_1.doc"

    I have a PrintView Command Button, when it is clicked it opens the invoices in Word format.

    My question is , Is there a way when the PrintView Button is clicked , it opens the invoices in PDF format rather than Word format?

    Here is my existing code.

    Private Sub PrintView_Click()
    Sheets("invoice").Select
    Dim fnd As Range
    With Range("B:B")
        .NumberFormat = "0"
        .Value = .Value
    End With
    Set fnd = Range("B:B").Find(TextBox5.Value, lookat:=xlWhole)
    If Not fnd Is Nothing Then
        Unload Me
         ThisWorkbook.FollowHyperlink (fnd.Offset(, 3).Value)
        Else: MsgBox "Number not found!"
    End If
    UserForm1.Show
    End Sub
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •