Got the individual worksheets going bang on and I thought it would also be a case of just transferring the code over to the 'ThisWorkbook' and away I would go to RESOLVED but as we have already discovered, I am not as clever as I would like to think I am...
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim xFileName As String
Dim L5part As String, H17part As String
'L5part = ThisWorkbook.Worksheets("Report template - Advanced").Range("L5").Value
'L5part = Replace(Replace(L5part, " / ", "/"), "/", "_")
'H17part = ThisWorkbook.Worksheets("Report template - Advanced").Range("H17").Value
'H17part = Replace(H17part, "/", "_")
L5part = ThisWorkbook.Worksheets("Report template - NextGen").Range("L5").Value
L5part = Replace(Replace(L5part, " / ", "/"), "/", "_")
H17part = ThisWorkbook.Worksheets("Report template - NextGen").Range("H17").Value
H17part = Replace(H17part, "/", "_")
'L5part = ThisWorkbook.Worksheets("Report template - All Future").Range("L5").Value
'L5part = Replace(Replace(L5part, " / ", "/"), "/", "_")
'H17part = ThisWorkbook.Worksheets("Report template - All Future").Range("H17").Value
'H17part = Replace(H17part, "/", "_")
If SaveAsUI <> False Then
Cancel = True
xFileName = Application.GetSaveAsFilename(H17part & " Report" & Range("A1").Value & L5part, "Excel Macro-Enabled Workbook (*.xlsm), *.xlsm", , "Save report as")
If xFileName <> "False" Then
Application.EnableEvents = False
ActiveWorkbook.SaveAs Filename:=xFileName, FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.EnableEvents = True
End If
End If
End Sub
The Save workbook is now causing the final bit of grief.....If I comment out two of the three worksheets, the Save Workbook routine works - but if they are uncommented then the routine fails to get the H17part and L5part information.