hello
I have this code save my file as pdf what I want adding hyperlink in sheet "archive" in column a every time I save as pdf then incrementing dynamically a1,a2,a3 ... and so on
I have this code save my file as pdf what I want adding hyperlink in sheet "archive" in column a every time I save as pdf then incrementing dynamically a1,a2,a3 ... and so on
VBA Code:
Sub SaveInvoiceWithNewName()
Dim OrigFN As Variant
Dim NewFN As Variant
' Remember the original path and file name
OrigFN = ThisWorkbook.FullName
ChDir "C:\aaa"
NewFN = "Inv" & Range("E5").Value & ".pdf"
' Save a copy with the new name
ActiveWorkbook.SaveAs Filename:="C:\aaa" & "\" & NewFN, FileFormat:=xlOpenXMLWorkbookMacroEnabled
' Delete the original workbook so you can save without warning
On Error Resume Next
Kill (OrigFN)
' On Error GoTo 0
' Save again as the original file name
ActiveWorkbook.SaveAs Filename:=OrigFN, FileFormat:=xlOpenXMLWorkbookMacroEnabled
NextInvoice
End Sub