I am trying to save a PO to another folder on our local network then clearing the information and automatically generating another invoice number and new sheet to write a new PO: Here is the VBA language I was using, which was working but now is not working and I keep getting an error 1004 SaveAs of object Workbook Failed. Any help would be appreciated. Thank you.
Sub SavePOWithNewName()
Dim NewFN As Variant
' Copy Purchase Order to new workbook
ActiveSheet.Copy
NewFN = "T:\Winemaking\Oak Alternatives\2020 Oak Alternatives\2020 Purchase Orders\FCC20-" & Range("F5").Value & Range("B10").Text & ".PDF"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
Sub SavePOWithNewName()
Dim NewFN As Variant
' Copy Purchase Order to new workbook
ActiveSheet.Copy
NewFN = "T:\Winemaking\Oak Alternatives\2020 Oak Alternatives\2020 Purchase Orders\FCC20-" & Range("F5").Value & Range("B10").Text & ".PDF"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub