I have this and it runs when the workbook is open but it closes after it runs. Any help would be great thanks.
Private Sub Workbook_open()
Dim path As String
Dim filename1 As String
' copy and paste
Sheets("Sheet1").Cells.Copy
Sheets("Sheet1").Cells.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
'end copy and paste
path = "C:\Users\hellerda\Desktop\test"
filename1 = Range("C9").Text
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=path & filename1 & "nox.xlsx", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
End Sub
Private Sub Workbook_open()
Dim path As String
Dim filename1 As String
' copy and paste
Sheets("Sheet1").Cells.Copy
Sheets("Sheet1").Cells.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
'end copy and paste
path = "C:\Users\hellerda\Desktop\test"
filename1 = Range("C9").Text
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=path & filename1 & "nox.xlsx", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
End Sub