S
Steve Roberts
I am trying to save and close the current .xls file the user is working on
then open a fresh unedited version of the file. I have the saving and
closing working ok but since closing the document that is running the code
stops everything, I can'd seem to get it to open the new file. Any ideas on
how to accomplish this?
Thanks
Steve
Private Sub btnSaveAndNew_Click()
Dim FS As FileSystemObject
Dim DT As Date
Dim strProjectDescription As String
Dim strProjectNumber As String
Dim strProjectFolder As String
Dim strInitials As String
Dim strDate As String
DT = Date
strDate = Format(DT, "dd-mmm-yy")
strProjectDescription = Range("c15")
strProjectNumber = Range("H5")
strProjectFolder = Replace(strProjectNumber, ".S.", "_")
strInitials = GetInitials()
Range("F5") = Date
Range("C5") = strInitials
ActiveWorkbook.SaveAs Filename:="G:\" & strProjectFolder & "\wp\" &
strProjectFolder & " PS " & strDate & strInitials & ".xls"
ActiveWorkbook.Close
End Sub
then open a fresh unedited version of the file. I have the saving and
closing working ok but since closing the document that is running the code
stops everything, I can'd seem to get it to open the new file. Any ideas on
how to accomplish this?
Thanks
Steve
Private Sub btnSaveAndNew_Click()
Dim FS As FileSystemObject
Dim DT As Date
Dim strProjectDescription As String
Dim strProjectNumber As String
Dim strProjectFolder As String
Dim strInitials As String
Dim strDate As String
DT = Date
strDate = Format(DT, "dd-mmm-yy")
strProjectDescription = Range("c15")
strProjectNumber = Range("H5")
strProjectFolder = Replace(strProjectNumber, ".S.", "_")
strInitials = GetInitials()
Range("F5") = Date
Range("C5") = strInitials
ActiveWorkbook.SaveAs Filename:="G:\" & strProjectFolder & "\wp\" &
strProjectFolder & " PS " & strDate & strInitials & ".xls"
ActiveWorkbook.Close
End Sub