Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
beforesave and beforeclose | Excel Programming | |||
Code Problem in BeforeSave Event | Excel Programming | |||
BeforeSave event | Excel Programming | |||
BeforeSave Sub | Excel Programming | |||
VBA - BeforeSave - NEED HELP | Excel Programming |