E
ExcelMonkey
I am distributing a file to clients and they are returning it to me.
want to send it out with the name "workbook1". When they return it t
me, I want to stop them from saving it under the same name. The cod
below works given that the file is already named "workbook1". Howeve
it also prevents the user from changing the name. Instead of using th
Name property as the test, I need to have the user attempt to save th
file and somehow pass the proposed name, that goes into the Save o
Save as filename box, to a variable and use this as the test tha
drives the Save Event.
Thanks
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
Dim FileName As String
FileName = ThisWorkbook.Name
If FileName = "Workbook1.xls" Then
MsgBox ("You cannot save this file using this name?" & vbCr & _
"It is recommended that you save it using your name as a
extension" & vbCr & _
"to this name(i.e. Workbook1JohnSmith)")
Cancel = True
End If
End Su
want to send it out with the name "workbook1". When they return it t
me, I want to stop them from saving it under the same name. The cod
below works given that the file is already named "workbook1". Howeve
it also prevents the user from changing the name. Instead of using th
Name property as the test, I need to have the user attempt to save th
file and somehow pass the proposed name, that goes into the Save o
Save as filename box, to a variable and use this as the test tha
drives the Save Event.
Thanks
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
Dim FileName As String
FileName = ThisWorkbook.Name
If FileName = "Workbook1.xls" Then
MsgBox ("You cannot save this file using this name?" & vbCr & _
"It is recommended that you save it using your name as a
extension" & vbCr & _
"to this name(i.e. Workbook1JohnSmith)")
Cancel = True
End If
End Su