A
Andibevan
Hi All,
I am trying to create a beforeSave event so that when the user presses save,
an inputbox comes up and the user specifies part of the filename and then
the code automatically adds additional information to the filename. I have
two problems:-
1) My code causes excel to crash
2) The inputbox comes up twice for some reason
Any ideas:-
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim FilePath As String
Dim varInput As String
FilePath = "S:\SmartMarket\SMV Project Administration\Sign-Offs\Construct
Phase\"
On Error GoTo addError
varInput = InputBox("......\Sign-Offs\Construct Phase\SMV - Sign-Off for
XXXXX.xls", _
"Sign-off Sheet Description")
ActiveWorkbook.SaveAs Filename:=FilePath & varInput & ".xls"
addError:
MsgBox "No value submitted - File Not Saved"
End Sub
Ta
Andi
I am trying to create a beforeSave event so that when the user presses save,
an inputbox comes up and the user specifies part of the filename and then
the code automatically adds additional information to the filename. I have
two problems:-
1) My code causes excel to crash
2) The inputbox comes up twice for some reason
Any ideas:-
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim FilePath As String
Dim varInput As String
FilePath = "S:\SmartMarket\SMV Project Administration\Sign-Offs\Construct
Phase\"
On Error GoTo addError
varInput = InputBox("......\Sign-Offs\Construct Phase\SMV - Sign-Off for
XXXXX.xls", _
"Sign-off Sheet Description")
ActiveWorkbook.SaveAs Filename:=FilePath & varInput & ".xls"
addError:
MsgBox "No value submitted - File Not Saved"
End Sub
Ta
Andi