Perhaps this...
Code:
Sub SaveInvWithNewName()
Dim NewFN
Dim variable1
Dim variable2
With ActiveSheet '<~~ this is the original invoice
' are these cells filled in?
If .Range("F16") = "" Or .Range("E31") = "" Or .Range("G31") = "" Then
MsgBox "some stuff missing"
Exit Sub
End If
variable1 = .Range("A32").Value
variable2 = .Range("A35").Value
.Copy 'creates new active workbook containing this invoice
End With
With ActiveSheet '<~~ now dealing with sheet in newly created workbook
.Range("A32").Value = variable1
.Range("A35").Value = variable2
.Cells.Locked = True
.Protect
NewFN = "C:\invoice\" & .Range("I5").Value & .Range("H5").Value & .Range("I49").Value & .Range("F16").Value
End With
With ActiveWorkbook
.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook '<~~ this will add the file extention .xlsx
Application.DisplayAlerts = True
.PrintOut From:=1, To:=1, copies:=2
.Close SaveChanges:=False
End With
Call NextInvoice
End Sub