Consulting

Results 1 to 6 of 6

Thread: PDF file not saving in right area

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Feb 2021
    Posts
    33
    Location

    PDF file not saving in right area

    Hi.

    I've written the below code, but the PDF is not saving in the below path and is saving the PDF into a different path. I can't see where it saves it to because the save box only appears for a sec. Can't see what I'm doing wrong. I'm simply saving the active sheet as a PDF. I've selected a particular range within the worksheet as a set printed area. Any ideas?


    Sub Save_PDF()
        Dim invno As Long
        Dim custname As String
        Dim Amt As Currency
        Dim dt_issue As Date
        Dim Path As String
        Dim fname As String
        Dim Nextrec As Range
        Dim dt_bill As Date
        invno = Range("c20")
        custname = Range("c1")
        Amt = Range("n48")
        dt_issue = Range("d20")
        dt_bill = Range("n20")
        Path = "Q:\Finance\Accounts\Finance\"
        fname = dt_bill & " " & custname & " " & invno
        ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF
    End Sub
    Last edited by Aussiebear; 02-23-2025 at 08:12 PM. Reason: Changed code tags to Code

Posting Permissions

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