Hi,
I'm quite new in vba and I was hoping someone could help me.
I have the following code, that saves a copy of a sheet "Loading Form" using as a name a value in cell C7:
Sub SaveITWithNewName()
Dim NewFN As Variant
If Range("C36").Value <= 0.8 Then
MsgBox "Truck not full"
Else
ActiveSheet.Copy
NewFN = "Path to the folder" & Range("C7").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextLoading
End If
End Sub
I keep having an error at line "ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook" although it has worked before and suddenly started with this error...
Can someone advise?
Thanks
I'm quite new in vba and I was hoping someone could help me.
I have the following code, that saves a copy of a sheet "Loading Form" using as a name a value in cell C7:
Sub SaveITWithNewName()
Dim NewFN As Variant
If Range("C36").Value <= 0.8 Then
MsgBox "Truck not full"
Else
ActiveSheet.Copy
NewFN = "Path to the folder" & Range("C7").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextLoading
End If
End Sub
I keep having an error at line "ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook" although it has worked before and suddenly started with this error...
Can someone advise?
Thanks