dannyok90
Board Regular
- Joined
- Aug 30, 2016
- Messages
- 115
The last part of this code is not working, its saying end with without with and I cant workout why? any ideas guys? happy new year!
Code:
Public Sub SaveAsC3()
Dim ThisFile As String, DoF As String
ThisFile = Range("C3").Value
DoF = Range("V2").Value
fName = "T:\V-Task\V0000+\200+\V0297\Shared\PSR Submissions\" & ThisFile & " " & "PSR" & " " & DoF
ActiveWorkbook.Save
On Error GoTo err
Application.DisplayAlerts = False
If (MsgBox("Are you sure you want to submit this PSR?", vbYesNo, "Decision")) = vbYes Then
With ActiveWorkbook
.SaveAs Filename:=fName, FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",TRUE)"
ActiveWindow.DisplayWorkbookTabs = True
Application.DisplayAlerts = False
If Workbooks.Count < 2 Then
Application.Quit
Else
ThisWorkbook.Close
End With
End If
err:
Application.DisplayAlerts = False
End Sub