Can not figure out the issue with this.
it saves the pdf but does not fill the records.
I followed a turtorial step by step and all worked until the last bit of code at the end....
Any help greatly appreciated.
FYI i am a beginner so may not understand references to items.
it saves the pdf but does not fill the records.
I followed a turtorial step by step and all worked until the last bit of code at the end....
Any help greatly appreciated.
FYI i am a beginner so may not understand references to items.
VBA Code:
Sub SaveInvAsExcel()
Dim invno As Long
Dim custname As String
Dim amt As Currency
Dim dt_issue As Date
Dim term As Byte
Dim path As String
Dim fname As String
invno = Range("C3")
custname = Range("B10")
amt = Range("I41")
dt_issue = Range("C5")
term = Range("C6")
path = "C:\Users\GeorgeDoucette\Desktop\THERMOTEK\Invoices\"
fname = invno & " - " & custname
Sheet27.Copy
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Delete
Next shp
With ActiveWorkbook
.Sheets(1).Name = "Invoice"
.SaveAs Filename:=path & fname, FileFormat:=51
.Close
End With
Set nextrec = Sheet28.Range("A1048576").End(xlUp).Offset(1, 0)
nextrec = invno
nextrec.Offset(0, 1) = custname
nextrec.Offset(0, 2) = amt
nextrec.Offset(0, 3) = dt_issue
nextrec.Offset(0, 4) = dt_issue + term
Sheet28.Hyperlinks.Add anchor:=nextrec.Offset(0, 7), Address:=path & fname & ".xlsx"
End Sub