Hey guys,
I am trying to automatically save a file when I exit a worksheet. I am also trying to use an input box to add text to the end of the file name. However every time I run the code it comes up with this error: "The specific dimension is not valid for the current chart type". The code is bellow and any help is appreciate.
I am trying to automatically save a file when I exit a worksheet. I am also trying to use an input box to add text to the end of the file name. However every time I run the code it comes up with this error: "The specific dimension is not valid for the current chart type". The code is bellow and any help is appreciate.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Weekday(Date) = 6 Then
ChDir "G:\CHPP\METALLURGY\Reports\2017\CHPP Summary\Weekly"
ActiveWorkbook.SaveAs Filename:= _
"G:\CHPP\METALLURGY\Reports\2017\CHPP Summary\Weekly\01 January17" & InputBox("Date", "Input the date", Date) & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False _
End If
End Sub