Hi,
I need some help here. Previously it was working fine with the exact same code.
And lately, it has been showing runtime error 1004 with the highlighted as per below.
I have no idea what is wrong when there was no change from the previous. Please help....
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "Z:\HoClinic\Official Receipt\Inv" & Range("M4").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
I need some help here. Previously it was working fine with the exact same code.
And lately, it has been showing runtime error 1004 with the highlighted as per below.
I have no idea what is wrong when there was no change from the previous. Please help....
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "Z:\HoClinic\Official Receipt\Inv" & Range("M4").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub